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.

TrialResult

What one trial of a sweep produced: predictions on the training and test sets, the labels they are scored against, the fit time, and optionally a per-epoch training loss.

Both label arrays travel with the predictions because a trial may have resampled its own training set (the class-imbalance sweep), so the runner cannot assume one y.

Operations

GetFitMs #

Fit time.

method : public : GetFitMs() ~ Float

Return

TypeDescription
Floatwall-clock milliseconds

GetLoss #

Training loss per epoch, when the trial recorded one.

method : public : GetLoss() ~ Float[]

Return

TypeDescription
Floatthe curve, or Nil

GetTestLabels #

True test labels.

method : public : GetTestLabels() ~ Bool[]

Return

TypeDescription
Boolone label per test row

GetTestPredictions #

Predicted test labels.

method : public : GetTestPredictions() ~ Bool[]

Return

TypeDescription
Boolone label per test row

GetTrainLabels #

True training labels.

method : public : GetTrainLabels() ~ Bool[]

Return

TypeDescription
Boolone label per training row

GetTrainPredictions #

Predicted training labels.

method : public : GetTrainPredictions() ~ Bool[]

Return

TypeDescription
Boolone label per training row

New # constructor

Constructor

New(train_pred:Bool[], train_y:Bool[], test_pred:Bool[], test_y:Bool[], fit_ms:Float)

Parameters

NameTypeDescription
train_predBoolpredicted labels on the training set
train_yBooltrue labels of the training set
test_predBoolpredicted labels on the test set
test_yBooltrue labels of the test set
fit_msFloatwall-clock milliseconds the fit took

New # constructor

Constructor with a training-loss curve.

New(train_pred:Bool[], train_y:Bool[], test_pred:Bool[], test_y:Bool[], fit_ms:Float, loss:Float[])

Parameters

NameTypeDescription
train_predBoolpredicted labels on the training set
train_yBooltrue labels of the training set
test_predBoolpredicted labels on the test set
test_yBooltrue labels of the test set
fit_msFloatwall-clock milliseconds the fit took
lossFloattraining loss per epoch