SHAP Interaction Values
SHAP interaction values extend ordinary feature attributions by splitting out how much of a prediction comes from two features acting together, rather than from either one alone.
Prerequisites: Feature Importance with SHAP
A standard SHAP value tells you how much each feature contributed to a single prediction, but it collapses any interaction between two features into their individual scores, hiding the fact that a feature's contribution might depend heavily on the value of another feature. SHAP interaction values fix this by splitting a prediction's total attribution into a main effect for each feature plus a separate interaction term for every pair of features, based on the same underlying Shapley-value math applied to pairs instead of singletons.
The result is a matrix rather than a single vector per prediction: diagonal entries are ordinary main effects, and off-diagonal entries capture how much two features jointly move the prediction beyond what each does alone. This is far more informative when two variables genuinely interact — like momentum only mattering in low-volatility regimes — but it is also more expensive to compute, since the number of pairs grows quadratically with the number of features.
SHAP interaction values decompose a prediction into per-feature main effects plus per-pair interaction effects, revealing when two features' joint influence is larger (or smaller) than the sum of their individual SHAP contributions would suggest.
Worked example
A model predicts stock returns using momentum and realized volatility. Ordinary SHAP values might show momentum contributing +0.4% and volatility contributing +0.1% to a given prediction. The SHAP interaction value between the two might reveal an additional +0.3% coming specifically from momentum being high while volatility is low — a joint effect invisible in the individual scores, and one that would disappear if either feature were examined on its own.
Related concepts
Further reading
- Lundberg et al., 'From Local Explanations to Global Understanding with Explainable AI for Trees'