GiniImpuritySelector<T>

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

Gini Impurity based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Gini impurity measures how mixed up the classes are. A pure group (all same class) has impurity 0. This selector keeps features that best reduce impurity when used to split the data - the same criterion decision trees use.

How It Works

Selects features based on their ability to reduce Gini impurity when used for splitting data, similar to decision tree feature importance.

Constructors

Constructor Summary
GiniImpuritySelector(int nFeaturesToSelect, int nSplits, int[] columnIndices)

Properties

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