The paper requires the following three properties of an explanation of the form in Eq. 1.
- Local accuracy (Property 1): At the x′ corresponding to the original input, the explanation model matches the output of the original model: f(x)=g(x′)=ϕ0+∑i=1Mϕixi′.
- Missingness (Property 2): A feature that is "absent" in the original input (xi′=0) gets a contribution of 0.
- Consistency (Property 3): If the model changes so that the increase in output from adding a feature becomes larger or stays the same regardless of which other features are present, that feature's contribution does not decrease.
Only one explanation satisfies all three, and it is the Shapley value (Theorem 1). Here fx(z′)=f(hx(z′)), ∣z′∣ is the number of ones in z′, and z′∖i is the input with zi′ set to 0. The sum is over all z′ whose ones lie in a subset of the positions of the ones in x′.
ϕi(f,x)=z′⊆x′∑M!∣z′∣!(M−∣z′∣−1)
The coefficient M!∣z′∣!(M−∣z′∣−1)! is the fraction of all orderings of the M features in which exactly the features of z′∖i come before feature i. Eq. 8 is therefore the same as "adding features one at a time and averaging, over all orderings, the increase when i is added." From this result, the paper states that methods not based on Shapley values violate either local accuracy or consistency.
SHAP values are Shapley values in which the model output is taken to be a conditional expectation. Many models cannot handle inputs in which features are "absent," so the expectation is taken over the absent features. S is the set of positions of ones in z′ and Sˉ is the rest.
fx(z′)=E[f(z)∣zS]≈EzSˉ[f(z)]≈f([zS,E[zSˉ]])
The first approximation assumes features are independent (Eq. 11), and the second assumes the model is linear (Eq. 12). The base value ϕ0=fx(∅) is the expected prediction E[f(z)] when no feature is known.
The right side of the diagram at the top shows the computation with three features: circle, triangle and background. Computing predictions for the 8 subsets and averaging the increases over the 6 orderings gives +0.61 for the circle, −0.19 for the triangle, and 0 for the background, which the prediction does not use. Adding these to the base value of 0.08 gives exactly the prediction of 0.50.