TRACK A · 10.2.3

SHAP Limitations

SHAP Limitations

Learning outcomes

1. What SHAP explains

SHAP decomposes a selected model output relative to a background: f(x)=v(∅)+Σφ. Additivity is not predictive accuracy.

2. Background data

Specify background and output scale (probability, logit, regression); compare like with like.

3. Dependent features

Conditional games use E[f(X)|X_S=x_S]; marginal games average missing features over the background and can create unsupported combinations.

4. Counterexample: unused B

With f(a,b)=a, rows (0,0),(1,1), x=(1,1), marginal base 0.5 and contributions (0.5,0); conditional (0.25,0.25). The unused b is informative in the conditional game. Neither proves causality.

5. Background shift

Three zero rows and one one row change base to 0.25, marginal (0.75,0), conditional (0.375,0.375); prediction stays 1.

6. Complexity and approximation

Exact enumeration scales as 2^M; assess approximation convergence and repeated runs. TreeSHAP exactness depends on its game and assumptions.

7. Global aggregation

Mean |φ| hides signs and subgroups. Check distributions, stability, predictive quality and drift.

8. Professional audit

Report model/version, background, output, masker, method, additivity residual, stability, counterexamples and limitations. Causal claims need additional assumptions and intervention evidence.

9. Laboratory

Run a-10-2-3-shap-limitations.py, change background frequencies and explain why the attribution changes despite constant prediction. Do not interpret contribution as an intervention effect.

Practice

Run a-10-2-3-shap-limitations.py, change background frequencies and explain why the attribution changes despite constant prediction. Do not interpret contribution as an intervention effect.

python a-10-2-3-shap-limitations.py

Python

balanced marginal (0.5, (0.5, 0.0))
balanced conditional (0.5, (0.25, 0.25))
shifted marginal (0.25, (0.75, 0.0))
shifted conditional (0.25, (0.375, 0.375))

Sources

Glossary

Background
Specify background and output scale (probability, logit, regression); compare like with like.
Conditional game
Conditional games use E[f(X)|X_S=x_S]; marginal games average missing features over the background and can create unsupported combinations.
Additivity
SHAP decomposes a selected model output relative to a background: f(x)=v(∅)+Σφ. Additivity is not predictive accuracy.

Self-check

Why can attributions change while the prediction stays fixed?

Three zero rows and one one row change base to 0.25, marginal (0.75,0), conditional (0.375,0.375); prediction stays 1.