def recall.go
import mlbend-metrics@0.1.0.0/main.bend as MlbendMetricsimport Base
272# the fraction of the samples really k that are predicted as k: the
273# recall of the class k
274def recall.go(r: Result<&1, &1, Bad, Nat>, +ys: List<&2, Nat>, +ps: List<&2, Nat>, +k: Nat) -> Result<&1, &1, Bad, F32>:
275 match r:
276 case Done{n}:
277 Done{ratio(count_both(ys, ps, k), count_true(ys, k))}
278 case Fail{Mismatch{expected, got}}:
279 Fail{Mismatch{expected, got}}
280 case Fail{Empty{}}:
281 Fail{Empty{}}