ElasticNetFS<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Embedded

Elastic Net-based feature selection.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → ElasticNetFS<T>

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Elastic Net is like LASSO but smarter about groups of related features. Instead of picking just one from a correlated group (like LASSO does), it can keep several if they’re all useful. This is great when you have features that measure similar things.

How It Works

Elastic Net combines L1 (LASSO) and L2 (Ridge) regularization to select features while handling correlated features better than pure LASSO. Features with non-zero coefficients are selected.

Constructors

Constructor Summary
ElasticNetFS(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; }
double Tolerance { get; }
int MaxIterations { 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)