Skip to content

treeshap

0.4.0

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

2packages depend
4.7Kdownloads / year
71.6%test coverage
13/13checks pass

Overview

About
Maintained by Michael MayerFirst published 2026-04-244 releasesCRAN page ↗GitHub ↗

An efficient implementation of the 'TreeSHAP' algorithm introduced by Lundberg et al., (2020) doi:10.1038/s42256-019-0138-9. 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'.

Install

Health

CRAN checks
13OK
Slowest check: 6.5 min · r-devel-windows-x86_64
Code health
Yes
Tests · ratio 0.80
71.6%
Coverage · measured lines
100%
Documentation · exports
3
Dependencies · direct
Check history
  • OK2026-08-04
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-08-01
    12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-04-25
    6 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMENoVignettesNopkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
27%
Documented parameters
99%
Return-value docs
100%
References docs
0%

Downloads

4.7K
CRAN downloads in the past year
Rank #3,288 · ~13/day · ~388/mo
Daily download trend is not available in this view yet.
93830 days
3.3K90 days
4.7K1 year
Compare downloads with other packages →
Also on393 r2u18 autocran

Repository

Repository
102Stars
25Forks
7Open issues
1Open PRs
4Releases
262Commits
10Contributors
explainabilityexplainable-aiexplainable-artificial-intelligenceexplanatory-model-analysisimlinterpretabilityinterpretable-machine-learningmachine-learning
License GPL-3.0 · 262 commits · Last activity 2026-05-13 · +2% stars, 30d

Stars over time

2025-05-22 · 862026-08-09 · 102

Repository practices

Upstream repositoryBeta

6 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/modeloriented/treeshap on 2026-08-16.

Continuous integration (1)
GitHub Actions
Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdrevdep/
Docs source (1)
README.Rmd
Show all practices
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
13 external dependencies (excludes base and recommended)
Depends (1)
R >= 4.1.0
LinkingTo (1)
Enhances (0)
none
Reverse dependencies
2direct
0indirect

Code & Tests

People & History

People (8)
Maintainer (1)
Author, Maintainer · added in 0.4.0
Authors (5)
Author, Maintainer · added in 0.4.0
Author, Copyright holder
Contributors (3)
Contributor
Contributor
Contributor
Copyright holders (1)
Author, Copyright holder
Package Timeline

4 releases. Pick two to compare their code metrics. R releases are shown for context.

  • 0.4.0Latest
    2026-04-24 · current release · diff ↗
  • unarchivedReturned to CRAN
    2026-04-24
  • R
    R 4.6.0 released · 2026-04-24
  • archivedRemoved from CRAN
    2025-12-17
    issues were not corrected in time
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 0.3.1
    2024-01-22 · diff ↗
  • unarchivedReturned to CRAN
    2024-01-22
  • archivedRemoved from CRAN
    2024-01-11
    issues were not corrected in time
  • 0.3.0
    2023-10-24 · diff ↗
  • 0.2.5
    2023-10-01
  • R
    R 4.3.0 released · 2023-04-21

Package metadata

First published
2026-04-24
Total releases
4 / 1 yrs
License
GPL-3 OSI
Minimum R
≥ 4.1.0
Bundled data
623 KB / 1 file
Download size
808 KB
Installed size
not tracked yet
With dependencies
not tracked yet

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("treeshap")
Mayer, M., Biecek, P., Kapsner, L. A., Komisarczyk, K., Kozminski, P., Krzyzinski, M., Maksymiuk, S., & Spytek, M. (2026). treeshap: Compute SHAP Values for Your Tree-Based Models Using the 'TreeSHAP' Algorithm (Version 0.4.0) [Computer software]. https://doi.org/10.32614/CRAN.package.treeshap

This is what citation() produces when a package has no citation file of its own. If it prints something else, use that.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for treeshap version 0.4.0 [Data set]. HJJB, LLC. Data release v2026-08-18. https://doi.org/10.5281/zenodo.21843040

From data release v2026-08-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy