LassoSelector<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Embedded
Lasso (L1) regularization-based feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → LassoSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Lasso is like a strict budget for your model. It forces the model to “spend” wisely on features, often setting unimportant feature weights to exactly zero. Features with non-zero weights after this “budgeting” process are considered important.
How It Works
Uses L1-regularized linear regression (Lasso) which drives some coefficients exactly to zero, performing automatic feature selection. The regularization parameter controls the sparsity of the solution.
Constructors
| Constructor | Summary |
|---|---|
LassoSelector(int nFeaturesToSelect, double alpha, int maxIterations, double tolerance, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> Coefficients { get; } |
|
bool SupportsInverseTransform { get; } |
|
int NFeaturesToSelect { get; } |
|
int[] SelectedIndices { get; } |
Methods
| Method | Summary |
|---|---|
Matrix<T> FitTransform(Matrix<T> data, Vector<T> target) |
|
bool[] GetSupportMask() |
|
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
|
void Fit(Matrix<T> data, Vector<T> target) |