def split_of

mlbend-split@0.1.1.0 · main.bend:160

import mlbend-split@0.1.1.0/main.bend as MlbendSplit
import Base

160# The rows of one fold: the ones that test and the ones that train.
161def split_of(fs: List<&2, Nat>, +f: Nat, +i: Nat, +test: List<&2, Nat>, +train: List<&2, Nat>) -> Split:
162  match fs:
163    case Nil{}:
164      Split{train, test}
165    case Con{+h, t}:
166      split_of(t, f, Nat.add(i, 1n), test_row(h, f, test, i), train_row(h, f, train, i))

Uses (6)

Used by (1)