v2026.10.0
All Bundles
Bundle

Core machine learning types: the seedable Random generator, Matrix2D linear algebra and activations, matrix reference holders, the NeuralNetwork and CSV-backed MatrixReader. Compile with -lib ml.

FoldSplit

The train and test matrices for one cross-validation fold.

Operations

GetTestRows #

The original row index of each row of the test split, in the order the test matrix holds them. Needed to map a fold score back to the record it belongs to, which is how an out-of-fold score vector is assembled. Split builds the test matrix by walking rows 0..n against a membership mask, so these come back ASCENDING and NOT in the order StratifiedKFold returned -- that order is shuffled. Without this accessor the obvious caller code pairs scores[k] with the k'th index of the fold vector, which silently scrambles them: measured on a 3000-row set, a pooled AUC of 0.997 read 0.539 -- chance -- while every per-fold AUC still read 0.99, so nothing looked wrong.

method : public : GetTestRows() ~ Int[]

Return

TypeDescription
Intone original row index per test row, or Nil from the 4-argument constructor

GetTestSize #

Rows in the test split.

method : public : GetTestSize() ~ Int

Return

TypeDescription
Inttest row count

GetTrainSize #

Rows in the training split.

method : public : GetTrainSize() ~ Int

Return

TypeDescription
Inttraining row count