def cell.go

mlbend-report@0.1.0.0 · main.bend:42

import mlbend-report@0.1.0.0/main.bend as MlbendReport
import Base
import mlbend-metrics@0.1.0.0/main.bend as M

42# The cell of the true label i and the predicted label j: how many
43# samples have both.
44def cell.go(ys: List<&2, Nat>, ps: List<&2, Nat>, +i: Nat, +j: Nat, n: Nat) -> Nat:
45  match ys ps:
46    case Con{y, yt} Con{p, pt}:
47      cell.go(yt, pt, i, j, (n + M.same(y, i) * M.same(p, j) : Nat))
48    case _ _:
49      n

Uses (5)

Used by (1)