def cls_of

mlbend-report@0.1.0.0 · main.bend:147

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

147# The report of one class: its precision, its recall, its F1 and its
148# support.
149def cls_of(+ys: List<&2, Nat>, +ps: List<&2, Nat>, +i: Nat) -> Cls:
150  +hits = M.count_both(ys, ps, i)
151  +support = M.count_true(ys, i)
152  +p = M.ratio(hits, M.count_pred(ps, i))
153  +r = M.ratio(hits, support)
154  Cls{p, r, M.f1_num(p, r), support}

Uses (8)

Used by (1)