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.
MatrixReader
Utilities for reading data from CSV data sources
Operations
LoadMatrices # function
Load input and output data into matrices. The row ending is taken from the file, so CRLF and LF both read. Every row is a record: a header row is read as one more record, its non-numeric cells as 0.0.
function : LoadMatrices(filename:String, target_offset:Int) ~ Vector[]<FloatMatrixRef>Parameters
| Name | Type | Description |
|---|---|---|
| filename | String | file to process |
| target_offset | Int | number of target columns, taken from the end of each row; the columns before them are the inputs |
Return
| Type | Description |
|---|---|
| Vector | input and output matrix data |
LoadSplitMatrices # function
Load input and output data into split matrices for training and testing. Every row is a record: a header row is read as one more record, its non-numeric cells as 0.0.
function : LoadSplitMatrices(filename:String, target_offset:Int, training_perc:Float, line_ending:String) ~ Vector[]<FloatMatrixRef>Parameters
| Name | Type | Description |
|---|---|---|
| filename | String | file to process |
| target_offset | Int | number of target columns, taken from the end of each row; the columns before them are the inputs |
| training_perc | Float | percentage of data used for training |
| line_ending | String | CSV line ending (i.e. Unix, Windows, etc.); omit it, or pass an empty string, to take the ending from the file |
Return
| Type | Description |
|---|---|
| Vector | split matrices for training and testing, first two matrices are training, latter two test data |