GlobalSHAPExplanation<T>

Models & Types · AiDotNet.Interpretability.Explainers

Represents global SHAP explanations aggregated across multiple instances.

For Beginners

While local SHAP explains one prediction, global SHAP helps you understand which features are important across ALL predictions.

It aggregates individual explanations to show:

  • Which features have the biggest impact on average
  • How consistent that impact is across different predictions

Constructors

Constructor Summary
GlobalSHAPExplanation(SHAPExplanation<T>[] localExplanations, string[] featureNames) Initializes a global SHAP explanation from local explanations.

Properties

Property Summary
SHAPExplanation<T>[] LocalExplanations { get; } Gets the individual explanations.
int NumFeatures { get; } Gets the number of features.
string[] FeatureNames { get; } Gets the feature names, if available.

Methods

Method Summary
IEnumerable<ValueTuple<int, string, T>> GetFeatureImportance() Gets feature importance ranking based on mean absolute SHAP values.
Vector<T> GetMeanAbsoluteShapValues() Gets the mean absolute SHAP value for each feature (global feature importance).
Vector<T> GetMeanShapValues() Gets the mean SHAP value for each feature (can be positive or negative).
Vector<T> GetShapValueStdDev() Gets the (population) standard deviation of SHAP values for each feature across all explanations.