def mae.go

mlbend-metrics@0.1.0.0 · main.bend:219

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

219# the mean absolute error between the targets and the predictions
220def mae.go(r: Result<&1, &1, Bad, Nat>, +ys: List<&2, F32>, +ps: List<&2, F32>) -> Result<&1, &1, Bad, F32>:
221  match r:
222    case Done{n}:
223      Done{mean(abs_sum.go(ys, ps, Sum{0n, 0.0}), n)}
224    case Fail{Mismatch{expected, got}}:
225      Fail{Mismatch{expected, got}}
226    case Fail{Empty{}}:
227      Fail{Empty{}}

Uses (8)

Used by (1)