FeatureAblationExplanation<T>

Models & Types · AiDotNet.Interpretability.Explainers

Result of feature ablation for a single input.

Implements: IFeatureAttribution<T>

Constructors

Constructor Summary
FeatureAblationExplanation(Vector<T> input, Vector<T> attributions, Vector<T> baseline, int[][] featureGroups, string[] featureNames, int targetClass, T basePrediction, Vector<T> ablatedPredictions) Initializes a new feature ablation explanation.

Properties

Property Summary
T BasePrediction { get; } Gets the base prediction score.
Vector<T> AblatedPredictions { get; } Gets predictions after ablating each feature/group.
Vector<T> Attributions { get; } Gets attributions for each feature/group.
Vector<T> Baseline { get; } Gets the baseline values used.
Vector<T> Input { get; } Gets the original input.
int NumGroups { get; } Gets the number of feature groups.
int TargetClass { get; } Gets the target class explained.
int[][] FeatureGroups { get; } Gets the feature groups.
string[] FeatureNames { get; } Gets feature/group names.

Methods

Method Summary
IEnumerable<ValueTuple<string, int[], T>> GetSortedFeatures() Gets features sorted by importance (absolute attribution).
IEnumerable<ValueTuple<string, int[], T>> GetTopFeatures(int k) Gets the top K most important features.
Vector<T> GetFeatureAttributions()
string ToString() Returns a human-readable summary.