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
| Type | Description |
|---|---|
| Int | one original row index per test row, or Nil from the 4-argument constructor |