GraphCanon updated 2w · GitHub synced 2w
Decision brief
dtreeviz is a Python library for enhancing decision tree and machine-learning model understanding through visualizations.
Good fit when
- When you need detailed and interactive visualization of decision trees from models trained with libraries like scikit-learn, XGBoost, LightGBM, or TensorFlow Decision Forests.
- For deepening the interpretability of complex model behaviors, especially in projects involving decision-support systems where model transparency is crucial.
Avoid when
- In scenarios where the primary focus is on model performance benchmarking as opposed to understanding or explaining existing models.
- If your project workflow does not involve Python, given dtreeviz's reliance on a specific set of Python ML libraries for its visualizations and interpretative functionalities.
Observed Jul 17, 2026 · Source: enrich:decision_facts
Verify the decision
Maintenance and security
Full trust report- Maintenance
- Slowing (212d since push)
- As of 2w
- Provenance
- Not a fork · Personal account
- As of 2w
- Security (OSV)
- No lockfile
- As of 1mo
Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.
Install
git clone https://github.com/parrt/dtreevizSimilar tools
Same-category neighbours. No typed graph edges are catalogued for this tool yet.
Evidence and technical details
Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.
Overview
dtreeviz is a Python library that provides functionalities for visualizing decision trees and interpreting machine-learning models.
Capability facts
- Languages
- jupyter notebook
Source: github.language · Aug 3, 2026
Categories
Compatibility
Sourced claims from the README excerpt - not unsourced marketing copy.
Source: README excerpt (regex_v1, Aug 3, 2026)
Here's a complete example Python file that displays the following tree in a popup window:Source link
Tags
README
Quick start
See Installation instructions then take a look at the specific notebooks for the supported ML library you're using:
- sklearn-based examples (colab)
- LightGBM-based examples (colab)
- Spark-based examples (colab)
- TensorFlow-based examples (colab) Also see blog at tensorflow.org Visualizing TensorFlow Decision Forest Trees with dtreeviz
- XGBoost-based examples (colab)
- Classifier decision boundaries for any scikit-learn model.ipynb (colab)
- Changing colors notebook (colab)
- AI-powered tree analysis (sklearn) - Interactive chat and explanations using LLMs
To interopt with these different libraries, dtreeviz uses an adaptor object, obtained from function dtreeviz.model(), to extract model information necessary for visualization. Given such an adaptor object, all of the dtreeviz functionality is available to you using the same programmer interface. The basic dtreeviz usage recipe is:
- Import dtreeviz and your decision tree library
- Acquire and load data into memory
- Train a classifier or regressor model using your decision tree library
- Obtain a dtreeviz adaptor model using
viz_model = dtreeviz.model(your_trained_model,...) - Call dtreeviz functions, such as
viz_model.view()orviz_model.explain_prediction_path(sample_x)
Example
Here's a complete example Python file that displays the following tree in a popup window:
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
import dtreeviz
iris = load_iris()
X = iris.data
y = iris.target
clf = DecisionTreeClassifier(max_depth=4)
clf.fit(X, y)
viz_model = dtreeviz.model(clf,
X_train=X, y_train=y,
feature_names=iris.feature_names,
target_name='iris',
class_names=iris.target_names)
v = viz_model.view() # render as SVG into internal object
v.show() # pop up window
v.save("/tmp/iris.svg") # optionally save as svg
In a notebook, you can render inline without calling show(). Just call view():
viz_model.view() # in notebook, displays inline
Installation
Install anaconda3 on your system, if not already done.
You might verify that you do not have conda-installed graphviz-related packages installed because dtreeviz needs the pip versions; you can remove them from conda space by doing:
conda uninstall python-graphviz
conda uninstall graphviz
To install (Python >=3.6 only), do this (from
For agents
This page has a .md twin and JSON over the API.