v2026.11.2
All Bundles
Bundle

Experiment support for a parameter sweep: a deterministic stratified hold-out split, class-ratio resampling of the training half against a fixed test set, a wall-clock stopwatch and label helpers. Compile with -lib ml,ml_lab,csv,json, or with the ai alias group. Design: docs/ML_LAB_SUPPORT_DESIGN.md.

DataSplit

The matrices and labels of a train/test split, plus the source row of every row in each half so predictions can be joined back to the original table.

Operations

GetTestRows #

Source row of each test row, ascending.

method : public : GetTestRows() ~ Int[]

Return

TypeDescription
Introw indexes into the matrix that was split

GetTestSize #

Rows in the test half.

method : public : GetTestSize() ~ Int

Return

TypeDescription
Inttest row count

GetTestX #

Test features.

method : public : GetTestX() ~ Float[,]

Return

TypeDescription
Floattest rows x features

GetTestY #

Test labels.

method : public : GetTestY() ~ Bool[]

Return

TypeDescription
Boolone label per test row

GetTrainRows #

Source row of each training row, ascending.

method : public : GetTrainRows() ~ Int[]

Return

TypeDescription
Introw indexes into the matrix that was split

GetTrainSize #

Rows in the training half.

method : public : GetTrainSize() ~ Int

Return

TypeDescription
Inttraining row count

GetTrainX #

Training features.

method : public : GetTrainX() ~ Float[,]

Return

TypeDescription
Floattraining rows x features

GetTrainY #

Training labels.

method : public : GetTrainY() ~ Bool[]

Return

TypeDescription
Boolone label per training row

New # constructor

Constructor

New(train_x:Float[,], train_y:Bool[], test_x:Float[,], test_y:Bool[], train_rows:Int[], test_rows:Int[])

Parameters

NameTypeDescription
train_xFloattraining rows x features
train_yBoolone label per training row
test_xFloattest rows x features
test_yBoolone label per test row
train_rowsIntsource row of each training row
test_rowsIntsource row of each test row