InformationGain<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter.InformationTheory
Information Gain (IG) for feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → InformationGain<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Entropy measures uncertainty - like not knowing what’s in a wrapped gift. Information Gain tells you how much knowing a feature reduces that uncertainty. If knowing your age perfectly predicts whether you’ll buy something, then age has high information gain for purchase prediction.
How It Works
Information Gain measures the reduction in entropy (uncertainty) about the target variable when a feature is known. Features with high information gain provide the most information about the target and are useful for prediction.
Constructors
| Constructor | Summary |
|---|---|
InformationGain(int nFeaturesToSelect, int nBins, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> InformationGains { get; } |
|
bool SupportsInverseTransform { get; } |
|
int NBins { 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) |