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.

Sample

A resampled training set: features, labels and the source row of every row, so duplicates from oversampling are visible.

Operations

GetPositiveRatio #

Share of positive rows actually achieved; report this, not the request.

method : public : GetPositiveRatio() ~ Float

Return

TypeDescription
Floatpositives over rows

GetRows #

Source row of each row of the sample. A row drawn twice by oversampling appears twice.

method : public : GetRows() ~ Int[]

Return

TypeDescription
Introw indexes into the matrix that was resampled

GetX #

Features.

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

Return

TypeDescription
Floatrows x features

GetY #

Labels.

method : public : GetY() ~ Bool[]

Return

TypeDescription
Boolone label per row

New # constructor

Constructor

New(x:Float[,], y:Bool[], rows:Int[])

Parameters

NameTypeDescription
xFloatrows x features
yBoolone label per row
rowsIntsource row of each row

Size #

Rows in the sample.

method : public : Size() ~ Int

Return

TypeDescription
Introw count