def mse.go
import mlbend-metrics@0.1.0.0/main.bend as MlbendMetricsimport Base
206# the mean squared error between the targets and the predictions
207def mse.go(r: Result<&1, &1, Bad, Nat>, +ys: List<&2, F32>, +ps: List<&2, F32>) -> Result<&1, &1, Bad, F32>:
208 match r:
209 case Done{n}:
210 Done{mean(sq_sum.go(ys, ps, Sum{0n, 0.0}), n)}
211 case Fail{Mismatch{expected, got}}:
212 Fail{Mismatch{expected, got}}
213 case Fail{Empty{}}:
214 Fail{Empty{}}