SHAP values for one decision

Explain one applicant's decision with exact Shapley values over five features.

IntermediateExplainable AI Lab
العربية

The idea

Change GPA, experience, income, years of study and test score; all 2⁵ coalitions are evaluated against a background sample.

Data description

Synthetic data generated in your browser from stated distributions; no real personal data.

Suggested next experiment

Concepts in this experiment

Do SHAP values mean a feature causes the outcome?

No. SHAP describes how the model uses features, not real-world causation. Correlated features can trade importance, and results depend on the background data.

Shapley value formula

v(S) is the mean prediction with features in S fixed and the rest from the background.

\phi_i=\sum_{S\subseteq F\setminus\{i\}}\frac{|S|!\,(|F|-|S|-1)!}{|F|!}\left[v(S\cup\{i\})-v(S)\right]
SHAP efficiency formula

SHAP values add up to prediction minus average prediction.

f(x)=\mathbb{E}[f(X)]+\sum_{i=1}^{M}\phi_i
SHAP values

Split the difference between a prediction and the average prediction across features using Shapley values (Lundberg & Lee, 2017), with efficiency, symmetry and null-player properties. The lab computes them exactly over all 32 coalitions of five features against a background sample, matching the shap library to 1e-9.

Scientific sources for this experiment

  1. A Unified Approach to Interpreting Model Predictions (arXiv:1705.07874)S. Lundberg, S.-I. Lee (2017) — Paper
  2. SHAP documentationS. Lundberg et al. (2025) — Tool

More in this module