L1RegularizationSelector<T>

Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Sparsity

L1 Regularization (Lasso-like) based Feature Selection.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ†’ L1RegularizationSelector<T>

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

L1 regularization adds a penalty proportional to the absolute value of coefficients. This penalty pushes weak coefficients to exactly zero, effectively selecting important features. The stronger the regularization, the fewer features are selected.

How It Works

Selects features using L1-regularized regression (Lasso), which automatically sets unimportant feature coefficients to zero.

Constructors

Constructor Summary
L1RegularizationSelector(int nFeaturesToSelect, double alpha, int maxIterations, int[] columnIndices)

Properties

Property Summary
Vector<T> Coefficients { get; }
bool SupportsInverseTransform { get; }
double Alpha { 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)