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.
LassoRegression
Lasso (L1-regularized) linear regression: an ElasticNet with l1_ratio fixed at 1.0. The L1 penalty drives uninformative feature coefficients exactly to zero, performing feature selection. Store/Load round-trip via the ElasticNet format (Load returns an ElasticNet).
Inherits: ElasticNet
Example
model := LassoRegression->New(0.1);
model->Fit(X, y); # sparse coefficientsOperations
New # constructor
Constructor with default optimization settings.
New(alpha:Float)Parameters
| Name | Type | Description |
|---|---|---|
| alpha | Float | L1 regularization strength (>= 0.0) |
New # constructor
Constructor with explicit optimization settings.
New(alpha:Float, iterations:Int, tolerance:Float)Parameters
| Name | Type | Description |
|---|---|---|
| alpha | Float | L1 regularization strength (>= 0.0) |
| iterations | Int | maximum coordinate-descent sweeps |
| tolerance | Float | stop when no coefficient moves more than this in a sweep |