4
$\begingroup$

Hey there data science stack exchange - question about SHAP.

In the original Shapley value formulation from Lloyd, one assumption is that the value function of the empty set equals zero, $v(\emptyset) = 0$. In other words, if no players are playing the game, the value function is zero (there is no payoff).

When Shapley values are adapted for interpretable ML (SHAP from Scott Lundberg), the payoff when no features are considered is the expectation of the prediction function. This is intuitive to me - when the model doesn't know the value of any features, its prediction equals its expectation, $E[f(x)]$ (see figure 1, page 5 in the link).

It's not clear to me, though, why the results from Lloyd still hold if the value function behaves differently for the empty set. Let me be a bit more clear.

Lloyd shows under certain axioms and the assumption that $v(\emptyset) = 0$, there's a unique solution for the Shapley value:

$ \phi_i(v) = \sum_{S \subset N} \frac{(s-1)!(n-s)!}{n!} \left[ v(S) - v(S-i) \right]$

But in the ML context, the assumption seems to change, with the value function of the empty set equalling something other than $0$. Why does the solution remain the same with this new assumption?

Looking at Lundberg's paper, there is related thing that is confusing me. At the top of page 4, equation 5 shows a desirable property of feature attribution methods.

$ f(x)= \phi_0+\sum_{i=1}^M \phi_i x$

Lunberg's just saying that attribution under linear feature attribution methods should add to equal the value of the prediction.

This aligns almost exactly with Lloyd's efficiency axiom, that the sum of the Shapley values of all players equals the "total payoff" when all players play the game.

But I think there's one thing different in Scott's equation, which is that it includes $\phi_0$. I don't think there is a $\phi_0$ in Lloyd's formulation. From Wikipedia, the efficiency axiom is: $\sum_{i \in N} \varphi_i(v)=v(N)$ where $i$ is a player in the set of players $N$. It doesn't make sense to have a Shapely value for a player that doesn't exist. Note, the Shapley value $\phi$ is different from the value function $v$. $v$ is defined for the empty set, but it's not clear to me that $\phi$ is defined for "no player".

$\endgroup$

1 Answer 1

3
$\begingroup$

At a high level, this mostly goes away by just defining the valuation function $v$ as the expected model output given the coalition (*abusing terminology and notation a little) minus the global expectation: $$ v(S) = E(f \mid S) - E(f) $$

Then indeed $v(\emptyset) = E(f) - E(f) = 0$. And then in the Shapley formula, you take the difference of two $v$-values, so that constant subtracted term just cancels; so that all works without adjustment, and the Shapley Efficiency property works out to the SHAP Local Accuracy property because the $v(N)$ on the right hand side also has that subtracted $\phi_0$.

$\endgroup$
1
  • $\begingroup$ Amazing! Makes perfect sense. $\endgroup$
    – shay
    May 21 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.