def accuracy.go

mlbend-metrics@0.1.0.0 · main.bend:245

import mlbend-metrics@0.1.0.0/main.bend as MlbendMetrics
import Base

245# the fraction of the samples predicted right
246def accuracy.go(r: Result<&1, &1, Bad, Nat>, +ys: List<&2, Nat>, +ps: List<&2, Nat>) -> Result<&1, &1, Bad, F32>:
247  match r:
248    case Done{n}:
249      Done{ratio(count_right(ys, ps), n)}
250    case Fail{Mismatch{expected, got}}:
251      Fail{Mismatch{expected, got}}
252    case Fail{Empty{}}:
253      Fail{Empty{}}

Uses (7)

Used by (1)