← Back to all sparks
T

treeshap

ANALYTICS
Velocity0.0

Compute SHAP values for your tree-based models using the TreeSHAP algorithm

treeshap keeps widening its tree-model coverage while the SHAP math stays put.

shapmodel explainabilitytree ensemblesr packageadapter coverage
Current state
treeshap computes exact SHAP values for tree ensembles in R, reaching each modelling framework through a per-framework unify() adapter. Since returning to CRAN in 2023 it has added GPBoost, ranger survival forests and multi-output models to that adapter layer. Four releases in three years, each dominated by adapter work contributed by users of one specific framework.
Where it's heading
The direction is breadth of model support rather than new explanation methods: every release since the first CRAN submission adds or repairs a unify() backend. Maintenance is community-driven, with named contributors fixing the framework they personally use. Nothing in these entries points at work on the SHAP algorithms themselves.
Prediction
Expect the next release to add or repair another unify() adapter as a contributor brings their own framework, rather than to change how explanations are computed.

Recent moves

  1. 3mo ago

    GPBoost support lands; xgboost adapter repaired

    GPBoost joins the adapter roster and the xgboost binding is repaired — the breadth-over-depth pattern that defines every treeshap release. The R floor moves to 4.1.0 as a side effect.

    View source ↗
  2. 2y ago

    Fixes broken lightgbm.unify examples

    A documentation-only patch repairing lightgbm.unify examples, issued shortly after the package's return from CRAN archival. No change to how explanations are computed.

    View source ↗
  3. 2y ago

    Multi-output model explanations added

    Multi-output models get their own unified and explanation classes, extending the adapter layer to a model shape it could not previously represent. Survival-forest handling from the prior release is corrected at the same time.

    View source ↗
  4. 2y ago

    First CRAN release consolidates the unify() adapters

    ⚡ SPARK

    The first CRAN release collapses the per-framework adapters behind one generic unify() and brings random survival forests into scope — the point at which treeshap became an installable general-purpose SHAP backend rather than a GitHub project.

    View source ↗