--- id: treeinterpreter version: "0.2.3" license: BSD license_treatment: permissive maintenance: abandoned --- # treeinterpreter — Package for interpreting scikit-learn's decision tree and random forest predictions. License: permissive · Maintenance: abandoned · Downloads: 103.5K/mo ## 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 above — 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 pip install treeinterpreter uv add treeinterpreter poetry add treeinterpreter ## Installing 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: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 103.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scikit-learn model interpretation, decision tree prediction decomposition, random forest feature contribution, explain tree predictions, model prediction attribution, model-interpretability [View on SkillFed](https://skillfed.io/packages/treeinterpreter) · [View on PyPI](https://pypi.org/project/treeinterpreter/)