PermutationImportance<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.ModelAgnostic
Permutation Importance for model-agnostic feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → PermutationImportance<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
This method works with any model. It asks: “What happens if I scramble this feature’s values?” If the model gets much worse, that feature was important. If the model doesn’t care, the feature wasn’t useful. It’s like testing each ingredient by removing it from a recipe.
How It Works
Permutation Importance measures feature importance by randomly shuffling each feature and observing how much model performance degrades. Features that cause large performance drops when shuffled are important.
Constructors
| Constructor | Summary |
|---|---|
PermutationImportance(int nFeaturesToSelect, int nPermutations, Func<Matrix<T>, Vector<T>, T> scorer, int? randomState, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> ImportanceScores { get; } |
|
Vector<T> ImportanceStd { get; } |
|
bool SupportsInverseTransform { get; } |
|
int NFeaturesToSelect { get; } |
|
int NPermutations { 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) |