GiniImpuritySelection<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter

Gini Impurity-based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Gini impurity measures how “mixed” a group is. If splitting data by a feature creates groups where samples are mostly the same class (pure groups), that feature is valuable. This method finds features that best separate different classes from each other.

How It Works

Measures how much each feature reduces impurity (Gini impurity) when used to split the data. Features that create purer groups after splitting are considered more important.

Constructors

Constructor Summary
GiniImpuritySelection(int nFeaturesToSelect, int nThresholds, int[] columnIndices)

Properties

Property Summary
Vector<T> GiniReductionScores { 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)