v2026.10.0
All Bundles
Bundle

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.

ScoreModel

Anything that fits on binary labels and scores rows. DecisionTreeClassifier, RandomForestClassifier and GradientBoostedClassifier all implement it, so CrossValidation->Evaluate takes any of them without knowing which. Scoring rather than predicting is the point: a Bool prediction fixes one operating point and cannot answer what recall would be at another, which is the whole question when alerts arrive against a fixed false-alarm budget.

Operations

Fit # virtual

Fits the model.

method : public : virtual : Fit(X:Float[,], y:Bool[]) ~ Bool

Parameters

NameTypeDescription
XFloatrows x features
yBoolone label per row, true for the positive class

Return

TypeDescription
Booltrue when the fit succeeded

PredictScore # virtual

Scores each row; higher means more positive.

method : public : virtual : PredictScore(X:Float[,]) ~ Float[]

Parameters

NameTypeDescription
XFloatrows x features

Return

TypeDescription
Floatone score per row, or Nil when unfitted