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
| Type | Description |
|---|---|
| Int | row indexes into the matrix that was split |
GetTestSize #
Rows in the test half.
method : public : GetTestSize() ~ IntReturn
| Type | Description |
|---|---|
| Int | test row count |
GetTestX #
Test features.
method : public : GetTestX() ~ Float[,]Return
| Type | Description |
|---|---|
| Float | test rows x features |
GetTestY #
Test labels.
method : public : GetTestY() ~ Bool[]Return
| Type | Description |
|---|---|
| Bool | one label per test row |
GetTrainRows #
Source row of each training row, ascending.
method : public : GetTrainRows() ~ Int[]Return
| Type | Description |
|---|---|
| Int | row indexes into the matrix that was split |
GetTrainSize #
Rows in the training half.
method : public : GetTrainSize() ~ IntReturn
| Type | Description |
|---|---|
| Int | training row count |
GetTrainX #
Training features.
method : public : GetTrainX() ~ Float[,]Return
| Type | Description |
|---|---|
| Float | training rows x features |
GetTrainY #
Training labels.
method : public : GetTrainY() ~ Bool[]Return
| Type | Description |
|---|---|
| Bool | one 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
| Name | Type | Description |
|---|---|---|
| train_x | Float | training rows x features |
| train_y | Bool | one label per training row |
| test_x | Float | test rows x features |
| test_y | Bool | one label per test row |
| train_rows | Int | source row of each training row |
| test_rows | Int | source row of each test row |