MahalanobisDistanceSelector<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Distance

Mahalanobis Distance based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Mahalanobis distance is like Euclidean distance but adjusted for how data is spread out. It’s useful when features are correlated or have different scales. Features that contribute more to class separation considering the data’s shape are selected.

How It Works

Selects features based on the Mahalanobis distance contribution, which accounts for correlations between features and class-specific covariances.

Constructors

Constructor Summary
MahalanobisDistanceSelector(int nFeaturesToSelect, int[] columnIndices)

Properties

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