treeinterpreter
Package for interpreting scikit-learn's decision tree and random forest predictions.
What it is and what it does
TreeInterpreter is a small library that breaks down predictions from tree-based models into interpretable components. For each prediction, it computes a bias term and a contribution value for each input feature, so you can see exactly how much each feature pushed the prediction up or down. This is useful when you need to explain individual predictions or debug why a model made a particular decision.
The package has no runtime dependencies and installs as a pure Python wheel. It is no longer maintained, with the last release in 2021-01-10 and no activity since 2023-07-18, so it may not work with newer versions without modification.
Use it for:
- Explain individual tree predictions to stakeholders by showing feature contributions.
- Debug model behavior by decomposing predictions and identifying which features dominate decisions.
- Audit model fairness by examining whether sensitive features have outsized contributions.
- Validate model logic by checking that prediction = bias + sum(contributions) holds across data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Decomposes scikit-learn decision tree and random forest predictions into bias and per-feature contribution components, enabling interpretation of how each feature drives individual predictions.
Yes, if you are working with tree models and need local prediction explanations on a stable codebase. The package is simple, dependency-free, and has no known vulnerabilities. However, do not use it if you depend on active maintenance or need compatibility with very recent versions—test thoroughly before deploying to production, as the project is abandoned.
Install
treeinterpreter on PyPI
pip
pip install treeinterpreteruv
uv add treeinterpreterpoetry
poetry add treeinterpreterInstalling treeinterpreter
Before you install
Low friction installation with no runtime dependencies. However, the package is abandoned—last release was 2021-01-10 and last commit 2023-07-18—so expect no bug fixes or updates.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions; you may use and modify the code freely as long as you retain the license notice.
Quickstart
pip install treeinterpreter
from treeinterpreter import treeinterpreter as ti
rf = RandomForestRegressor()
rf.fit(trainX, trainY)
prediction, bias, contributions = ti.predict(rf, testX)
Requires scikit-learn 0.17 or later; no Python version constraint is documented.
Verify before relying
- Whether the package remains compatible with scikit-learn 0.17+ across current versions.
- Python version support beyond the unspecified classifier.
- Whether the package works with the eight tree model types listed in the description.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,042 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 103,532/month — #12,801 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: treeinterpreter-0.2.3-py2.py3-none-any.whl
Keywords: treeinterpreter
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
forestciComputes confidence intervals and variance…
permissive · top 15,000 on PyPI
dtreevizdtreeviz renders decision trees from…
permissive · top 15,000 on PyPI
BorutaBoruta performs all-relevant feature selection…
permissive · top 15,000 on PyPI
interpret-coreTrains interpretable machine learning models…
unclear · top 5,000 on PyPI
interpretInterpretML provides interpretable machine…
unclear · top 15,000 on PyPI
ydfYDF trains, evaluates, and interprets decision…
permissive · top 15,000 on PyPI
treeliteTreelite serializes and exchanges decision tree…
permissive · top 15,000 on PyPI
treelite-runtimeTreelite-runtime provides a Python runtime for…
permissive · top 15,000 on PyPI
limeLime explains individual predictions from any…
permissive · top 15,000 on PyPI
quantile-forestQuantile regression forests for estimating…
permissive · top 15,000 on PyPI