Bundle Machine learning library with linear regression, logistic regression, k-means clustering, and matrix operations. Designed for tabular data; supports training, prediction, and model evaluation. Compile with -lib ml.
CrossValidation
Cross-validation utilities for model evaluation
Operations
KFold # native
Splits data into K folds for cross-validation
function : native : KFold(data:Float[,], k:Int) ~ Vector[]<IntRef>Parameters
| Name | Type | Description |
|---|---|---|
| data | Float | input matrix |
| k | Int | number of folds |
Return
| Type | Description |
|---|---|
| Vector | array of K fold indices |
TrainTestSplit # native
Splits data into training and test sets
function : native : TrainTestSplit(data:Float[,], test_ratio:Float) ~ FloatMatrixRef[]Parameters
| Name | Type | Description |
|---|---|---|
| data | Float | input matrix |
| test_ratio | Float | percentage of data for testing (0.0 to 1.0) |
Return
| Type | Description |
|---|---|
| FloatMatrixRef | array with [training_data, test_data] |