v2026.6.1
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.

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 coefficients

Operations

New # constructor

Constructor with default optimization settings.

New(alpha:Float)

Parameters

NameTypeDescription
alphaFloatL1 regularization strength (>= 0.0)

New # constructor

Constructor with explicit optimization settings.

New(alpha:Float, iterations:Int, tolerance:Float)

Parameters

NameTypeDescription
alphaFloatL1 regularization strength (>= 0.0)
iterationsIntmaximum coordinate-descent sweeps
toleranceFloatstop when no coefficient moves more than this in a sweep