Skip to content

SHAP values

In the app: Help → Help contents, SHAP values.

A machine-learning fit has no coefficients to read. SHAP values split each prediction into a base value (the average prediction) and one contribution per regressor: the Shapley values of a game whose players are the regressors and whose payoff is the prediction with only some of them known. They add up to the prediction exactly, a regressor the model ignores gets zero, and two regressors the model uses alike get the same. Averaged as mean |SHAP|, they rank the regressors by how much the predictions move with each, a companion to permutation importance.

For trees (random forests, boosted trees, LightGBM, XGBoost), TreeSHAP computes them exactly from the trees themselves, with an absent regressor handled by following each split in proportion to the training observations that went each way. For other learners they come from the model's predictions, with absent regressors drawn from a background sample of the training periods: exactly, over every subset of regressors, when there are at most ten; otherwise from a seeded sample of orderings, whose seed and number of evaluations are recorded. Either way they describe the fitted model, not causal effects, and with correlated regressors the credit each gets depends on how absence is defined.

See also

References

  • Shapley, L. S. (1953). A value for n-person games. In Kuhn, H. W. and Tucker, A. W. (eds.), Contributions to the Theory of Games, volume 2, 307-317. Princeton University Press. (search)
  • Lundberg, S. M. and Lee, S.-I. (2017). A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems 30, 4765-4774. (search)
  • Lundberg, S. M., Erion, G., Chen, H., DeGrave, A., Prutkin, J. M., Nair, B., Katz, R., Himmelfarb, J., Bansal, N. and Lee, S.-I. (2020). From local explanations to global understanding with explainable AI for trees. Nature Machine Intelligence 2(1), 56-67. (search)