ElasticNetSelector<T>

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

Elastic Net Regularization based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Elastic Net combines Lasso (which sets unimportant features to zero) and Ridge (which handles correlated features well). Features that survive this double penalty are likely important.

How It Works

Uses Elastic Net regularization (combination of L1 and L2 penalties) to select features by identifying those with non-zero coefficients after regularized regression.

Constructors

Constructor Summary
ElasticNetSelector(int nFeaturesToSelect, double alpha, double l1Ratio, int maxIterations, double tolerance, int[] columnIndices)

Properties

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