FusedLasso<T>

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

Fused Lasso (Total Variation) for feature selection with smoothness constraints.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

When features are ordered (like wavelengths or time points), you often expect nearby features to behave similarly. Fused Lasso encourages smooth coefficient patterns while still allowing for sparse solutions where coefficients jump abruptly only at important boundaries.

How It Works

Fused Lasso adds a penalty on the differences between consecutive coefficients, encouraging nearby features to have similar coefficients. This is useful when features have a natural ordering (e.g., spectral data, time series).

Constructors

Constructor Summary
FusedLasso(int nFeaturesToSelect, double alpha, double fusedPenalty, int maxIterations, double tolerance, int[] columnIndices)

Properties

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