def one_hot_rows_go
import mlbend-preprocess@0.1.0.0/main.bend as MlbendPreprocessimport Base
259# The rows of a one-hot matrix, label by label.
260def one_hot_rows_go(+labels: List<&2, Nat>, +k: Nat, +acc: List<&2, List<&2, F32>>) ->
261 List<&2, List<&2, F32>>:
262 match labels:
263 case Nil{}:
264 acc
265 case Con{h, t}:
266 one_hot_rows_go(t, k, List.append(&2, List<&2, F32>, acc, Con{one_hot_row(h, k), Nil{}}))