InformationGain<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter
Information Gain (Mutual Information) for feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → InformationGain<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Information Gain asks: “How much does knowing this feature reduce my uncertainty about the target?” If knowing the feature value tells you a lot about what the target will be, it has high information gain. It’s measured in bits (or nats, depending on the logarithm base).
How It Works
Information Gain measures the reduction in entropy of the target variable when a feature is known. It’s equivalent to mutual information and quantifies how much information about the target a feature provides.
Constructors
| Constructor | Summary |
|---|---|
InformationGain(int nFeaturesToSelect, int nBins, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
bool SupportsInverseTransform { get; } |
|
double[] InformationGains { 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) |