Skip to content

treeshap

0.4.0Package record

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

0packages dependsuggested by 3
7Kdownloads / year
71.6%test coverage
13/13flavors OK

Overview

About

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'.

Changes in 0.4.0

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.2 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK6 OK2026-04-25
Advisories

none known

Documentation

In release 0.4.0
README· In the repository, left out of the releaseVignettesNoNEWSYes · 100% structured · mentions 0.4.0Citation fileNoWebsiteYes · pkgdown
Help pages
28
Examples that run
27%4 run in a plain check (4 of them under a condition) · 11 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
78%
Documented parameters
99%
Return-value docs
100%
Help pages citing references
0%

Downloads

7K
CRAN downloads in the past year
Rank #3,420 · ~19/day · ~582/mo
Daily download trend is not available in this view yet.
1.1K30 days
3.2K90 days
7K1 year
Compare downloads with other packages →
Also on377 r2u4 autocran

Repository

106Stars
25Forks
7Open issues
1Open PRs
4Releases
262Commits
10Commit identities
explainabilityexplainable-aiexplainable-artificial-intelligenceexplanatory-model-analysisimlinterpretabilityinterpretable-machine-learningmachine-learning
License file reads as GPL-3.0 · 262 commits · Last activity 2026-04-24 · +1.9% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
632
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2025-10-22 · 892026-10-21 · 106
PracticesBeta

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

Checks run against github.com/modeloriented/treeshap on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-05-02 · The repository has a site deploy workflow

Coverage (1)
Coverage reporting
Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2026-05-13
    Pull request: opened by its own account
How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
13 external dependencies (excludes base and recommended)

Installing treeshap adds 19 packages (9 with compiled code, 21 MB of source tarballs). Heaviest: ggplot2 6.0 MB, data.table 5.7 MB, Rcpp 1.8 MB.

Depends (1)
R >= 4.1.0
LinkingTo (1)
Enhances (0)
none
Reverse dependencies
0direct
0indirect
Suggested by 3
Suggests, most downloaded first

Datasets

People & History

People (8)
Author, Maintainer since 0.4.0 (2026) · added in 0.4.0
Author, Copyright holder
Contributor
Contributor
Contributor

Previously maintained by Mateusz Krzyzinski (0.2.5 to 0.3.1).

Releases (4)

Pick two releases to compare their code metrics.

  • unarchivedReturned to CRAN
    2026-04-24
  • 0.4.0Latest
    record
    2026-04-24 · current release · diff ↗ ·
    added 1 export
    gpboost.unify
  • 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
  • unarchivedReturned to CRAN
    2024-01-22
  • 0.3.1
    record
    2024-01-22 · diff ↗
  • archivedRemoved from CRAN
    2024-01-11
    issues were not corrected in time
  • 0.3.0
    record
    2023-10-24 · diff ↗
  • 0.2.5
    record
    2023-10-01
  • R
    R 4.3.0 released · 2023-04-21

Package metadata

First published
2023-10-01
Total releases
4 / 3 yrs
License
GPL-3 OSI
Minimum R
≥ 4.1.0
Bundled data
623 KB / 1 file
Download size
808 KB

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 package has no citation file, so citation() returns this entry built from DESCRIPTION.

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-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, 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