HughChen / its_blog

Blog post explaining the algorithm behind interventional tree shap
5 stars 1 forks source link

Proof for Theorem1 #1

Open JJYsRepo opened 2 years ago

JJYsRepo commented 2 years ago

How can we get the final result for calculating phi for path P? It seems to be a magic to me. image Thanks all.

HughChen commented 2 years ago

Hello!

We are using the original shapley value formula here:

Screen Shot 2021-10-07 at 8 13 51 AM

Where if $S_p$ contains $i$, we want to subtract by one, since in the original formula $|S|$ does not include $i$. In words, at each leaf we are basically computing one of the terms in the above summation (if each path encounters each feature in the full set of features $N$, then it is exactly the same as the above summation).

The subtle part is that if we encounter fewer features ($N_p$) than are in the full game ($N$), then we can use a weighting term based on $N_p$, rather than all features $N$. This is just a consequence of the weighting term for which the numerator counts the number of combinations that correspond to the given set. Since the proportion of combinations is the same with all features $N$ and with the subset of features $N_p$, it is simpler to use $N_p$ instead.