Calculating Shapley Values
- \(p!\): The total number of possible permutations (or orderings) of these variables.
- \(J\): A possible permutation of the set of explanatory variables \(\{1,2,\ldots,p\}\) included in the model \(f()\).
- \(\pi(J,j)\): Set of the indices of the variables that are positioned in \(J\) before the \(j\)-th variable.
- \(\Delta^{j|\pi(J,j)}(\underline{x}_*)\): The variable-importance measure of \(j\) due the variables that have been used before (constant for all permutations \(J\))
Average of the variable-importance measures across all possible orderings of explanatory variables
\[ \varphi(\underline{x}_*,j) = \frac{1}{p!} \sum_{J} \Delta^{j|\pi(J,j)}(\underline{x}_*) \]
For a large \(p\) we can use Monte Carlo estimator