--- id: dtreeviz version: "2.3.2" license: MIT license_treatment: permissive maintenance: aging --- # dtreeviz — A Python 3 library for sci-kit learn, XGBoost, LightGBM, Spark, and TensorFlow decision tree visualization License: permissive · Maintenance: aging · Downloads: 84.2K/mo ## What it is and what it does dtreeviz is a Python visualization library that transforms decision trees from popular machine learning frameworks into clear, interpretable diagrams. It supports scikit-learn, XGBoost, LightGBM, Spark MLlib, and TensorFlow, making it a bridge between model training and human understanding. The library renders trees as visual graphs that show how features split at each node and how predictions flow through the model, inspired by educational design principles. The package depends on graphviz for rendering, pandas and numpy for data handling, scikit-learn for tree structure access, matplotlib for graphics, and colour for visual styling. It's primarily used by data scientists and ML engineers who need to explain model behavior to stakeholders, debug model decisions, or learn how tree-based models work internally. Use it for: - Visualize a trained decision tree to understand which features matter most at each split. - Generate publication-quality diagrams of trees for model documentation and reports. - Debug predictions by inspecting the decision paths individual trees take. - Teach machine learning concepts by showing how decision trees partition feature space visually. - Interpret model behavior for regulatory or compliance audits by displaying exact decision logic. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. dtreeviz renders decision trees from scikit-learn, XGBoost, LightGBM, Spark MLlib, and TensorFlow as interactive visualizations to help understand and interpret how these models make predictions. Yes, if you work with tree-based models and need to visualize or interpret them. The library is stable, permissively licensed, and has low install friction. The aging maintenance status (no release in 224 days) is a minor concern if you rely on cutting-edge framework versions, but core functionality remains sound for current releases. ## Install pip install dtreeviz uv add dtreeviz poetry add dtreeviz ## Installing dtreeviz Before you install: Low friction install with six common data-science dependencies (graphviz, pandas, numpy, scikit-learn, matplotlib, colour). Maintenance status is aging—last release was 224 days ago—but the repository remains active with 3154 stars. License in practice: MIT license is permissive; you can use, modify, and distribute dtreeviz with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install dtreeviz from dtreeviz.trees import dtreeviz viz = dtreeviz(tree_model, X, y, feature_names=feature_names, class_names=class_names) Requires graphviz system library to be installed separately on your machine for rendering to work. Verify before relying: - Whether the aging maintenance status (224 days since last release) affects support for newer versions of supported frameworks. - Performance characteristics when visualizing very large or deeply nested trees. - Current compatibility with TensorFlow decision forests given the maintenance timeline. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 84.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags decision tree visualization, tree model interpreter, machine learning model visualization, xgboost tree diagrams, random forest visualization, gradient boosting tree viz, model interpretation, model-interpretation, visualization, tree-based-ml [View on SkillFed](https://skillfed.io/packages/dtreeviz) · [View on PyPI](https://pypi.org/project/dtreeviz/)