SparseGroupLasso<T>
Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Sparse
Sparse Group Lasso for feature selection with grouped structure.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ SparseGroupLasso<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Imagine features organized into categories (e.g., color features, shape features). Sometimes you want to select entire categories, other times specific features within categories. Sparse Group Lasso does both: it can eliminate entire groups or pick individual features within groups.
How It Works
Sparse Group Lasso combines L1 (Lasso) and L2 (Group Lasso) penalties to select both entire groups of features and individual features within groups. This is useful when features have a natural grouping structure.
Constructors
| Constructor | Summary |
|---|---|
SparseGroupLasso(int nFeaturesToSelect, double alpha, double l1Ratio, int[] groups, 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[] Groups { 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) |