Compute SHAP Values for Your Tree-Based Models Using the 'TreeSHAP' Algorithm

An efficient implementation of the 'TreeSHAP' algorithm introduced by Lundberg et al., (2020) . It is capable of calculating SHAP (SHapley Additive exPlanations) values for tree-based models in polynomial time. Currently supported models include 'gbm', 'randomForest', 'ranger', 'xgboost', 'lightgbm'.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("treeshap")

0.4.0 by Michael Mayer, 7 months ago


https://modeloriented.github.io/treeshap/, https://github.com/ModelOriented/treeshap


Report a bug at https://github.com/ModelOriented/treeshap/issues


Browse source code at https://github.com/cran/treeshap


Authors: Michael Mayer [aut, cre] , Konrad Komisarczyk [aut] , Pawel Kozminski [aut] , Szymon Maksymiuk [aut] , Lorenz A. Kapsner [ctb] (ORCID: , Mikolaj Spytek [ctb] , Mateusz Krzyzinski [ctb] (ORCID: , Przemyslaw Biecek [aut, cph] (ORCID:


Documentation:   PDF Manual  


GPL-3 license


Imports data.table, ggplot2, Rcpp

Suggests gbm, jsonlite, lightgbm, gpboost, randomForest, ranger, scales, survival, testthat, xgboost

Linking to Rcpp


Imported by shapley.

Suggested by AgriFusionR, mossyforest, survex, ubair.


See at CRAN