What are the Shapley value formula and its four uniqueness axioms, and for a 3-feature model F={1,2,3} with coalition values v(∅)=10, v({1})=14, v({2})=12, v({3})=11, v({1,2})=20, v({1,3})=15, v({2,3})=13 and v({1,2,3})=25, what are the exact Shapley attributions ϕ1,ϕ2,ϕ3 (verifying efficiency)?

ML systems and evaluation, Interpretability
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you know the cooperative-game foundation of SHAP and can compute exact Shapley marginal contributions across subsets.

Key idea

The Shapley value ϕi=∑S⊆F∖{i}∣S∣!(∣F∣−∣S∣−1)!∣F∣![v(S∪{i})−v(S)] averages feature i’s marginal contribution across every subset S not containing i (with coalition value v(S)) over all ∣F∣! feature arrival orderings, uniquely satisfying efficiency, symmetry, dummy and additivity.

Steps

  1. Write the formula and state the four axioms: efficiency (∑iϕi=v(F)−v(∅)), symmetry (equal marginal contributions give equal ϕi), dummy (zero marginal contribution gives ϕi=0), and additivity (ϕi(v+w)=ϕi(v)+ϕi(w) for any two coalition value functions v and w).
  2. For ∣F∣=3, the subset weights ∣S∣!(2−∣S∣)!6 are: 13 for ∣S∣=0, 16 for each ∣S∣=1 subset, and 13 for ∣S∣=2.
  3. Compute ϕ1: 13(14−10)+16(20−12)+16(15−11)+13(25−13)=43+86+46+123=8+8+4+246=446=223≈7.333.
  4. Compute ϕ2: 13(12−10)+16(20−14)+16(13−11)+13(25−15)=23+66+26+103=4+6+2+206=326=163≈5.333.
  5. Compute ϕ3: 13(11−10)+16(15−14)+16(13−12)+13(25−20)=13+16+16+53=2+1+1+106=146=73≈2.333.
  6. Verify efficiency: ϕ1+ϕ2+ϕ3=22+16+73=453=15=25−10=v(F)−v(∅).
  7. Note the practical caveat: exact Shapley values scale as O(2∣F∣) in general, and defining v(S) via marginal vs conditional expectations faces the same off-manifold issue as PDP unless TreeSHAP or conditional samplers are used.

Common mistakes

How long your answer should be

Half a page with all three sums and axiom list; 6–8 minutes.

Last checked on 4 December 2026.

Read this

Previous in ML systems and evaluation: A weight tensor of 100 million parameters stored in FP32 (4 bytes each) spans the range [−0.64,+1.91]. What are the unsigned INT8 ([0,255]) affine scale s and zero-point z, what are the quantised and dequantised values and error for w=0.314, and how much parameter memory is saved?
Next in ML systems and evaluation: In online A/B testing, CUPED reduces metric variance by replacing the outcome Y with Ycuped=Y−θ(X−E[X]), where X is a pre-experiment covariate unaffected by treatment. How do you show that E[Ycuped]=E[Y] (unbiasedness), derive the variance-minimising θ∗, and prove that the minimum variance is Var⁡(Y)(1−ρ2) where ρ=Corr⁡(X,Y)?