GiniIndex<T>

Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Filter.Univariate

Gini Index for feature selection based on impurity reduction.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Gini measures how mixed a group is. A group with all same-class items has Gini=0 (pure). A 50/50 split has Gini=0.5. Good features create pure groups when you split by them.

How It Works

The Gini Index measures impurity in classification. Features that split data into purer groups (lower Gini) are more informative for prediction.

Constructors

Constructor Summary
GiniIndex(int nFeaturesToSelect, int nBins, int[] columnIndices)

Properties

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