BanzhafFeatureSelector<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.GameTheory

Banzhaf Power Index-based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

The Banzhaf index measures how often adding a feature changes the outcome (makes a coalition successful). Unlike Shapley, it treats all coalition sizes equally. Features with high Banzhaf values are “swing voters” that often make the difference.

How It Works

Uses the Banzhaf power index from game theory to measure feature importance based on the probability of being a swing voter (decisive feature).

Constructors

Constructor Summary
BanzhafFeatureSelector(int nFeaturesToSelect, int nSamples, double threshold, int? randomState, int[] columnIndices)

Properties

Property Summary
Vector<T> BanzhafIndices { get; }
bool SupportsInverseTransform { get; }
double Threshold { 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)