FeatureImportanceResult<T>

Models & Types · AiDotNet.Interpretability.Explainers

Represents the result of permutation feature importance calculation.

Constructors

Constructor Summary
FeatureImportanceResult(Vector<T> importances, Vector<T> importanceStds, T baselineScore, string[] featureNames) Initializes a new feature importance result.

Properties

Property Summary
T BaselineScore { get; } Gets the baseline model score (before any permutation).
Vector<T> ImportanceStds { get; } Gets the standard deviation of importance scores across repeats.
Vector<T> Importances { get; } Gets the importance score for each feature (mean drop in performance when permuted).
int NumFeatures { get; } Gets the number of features.
string[] FeatureNames { get; } Gets the feature names, if available.

Methods

Method Summary
Dictionary<string, T> ToDictionary() Converts to a dictionary mapping feature names/indices to importance scores.
IEnumerable<ValueTuple<int, string, T, T>> GetSortedFeatures() Gets features sorted by importance (most important first).
IEnumerable<ValueTuple<int, string, T, T>> GetTopFeatures(int n) Gets the top N most important features.
string ToString() Returns a human-readable summary.