PermutationImportance<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Embedded

Permutation Importance feature selection by measuring score decrease when shuffling features.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Imagine you have a trained model and want to know which features it relies on. You shuffle one feature’s values randomly (like shuffling a deck of cards) and see how much worse the model performs. If performance drops a lot, that feature was important. If shuffling makes no difference, the feature wasn’t useful.

How It Works

Permutation Importance measures the decrease in model performance when a single feature’s values are randomly shuffled, breaking the relationship between the feature and the target. Features whose shuffling causes large performance drops are considered important.

Constructors

Constructor Summary
PermutationImportance(int nFeaturesToSelect, int nRepeats, Func<Matrix<T>, Vector<T>, T> scorer, int? randomState, int[] columnIndices)

Properties

Property Summary
T BaselineScore { get; }
Vector<T> ImportanceStds { get; }
Vector<T> Importances { get; }
bool SupportsInverseTransform { get; }
int NFeaturesToSelect { get; }
int NRepeats { 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)