ShapleyFeatureSelector<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.GameTheory
Shapley Value-based Feature Selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → ShapleyFeatureSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Shapley values come from game theory and measure how much each “player” (feature) contributes to the team’s success (model accuracy). They consider all possible combinations of features, giving a fair and complete picture of each feature’s true importance.
How It Works
Uses Shapley values from cooperative game theory to fairly attribute contribution to each feature based on all possible feature coalitions.
Constructors
| Constructor | Summary |
|---|---|
ShapleyFeatureSelector(int nFeaturesToSelect, int nSamples, int? randomState, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> ShapleyValues { get; } |
|
bool SupportsInverseTransform { get; } |
|
int NFeaturesToSelect { get; } |
|
int NSamples { 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) |