Discover and explore top open-source AI tools and projects—updated daily.
parrtDecision tree visualization and interpretation SDK
Top 15.2% on SourcePulse
This Python library addresses the challenge of visualizing and interpreting decision trees, crucial components in popular machine learning models like Random Forests and gradient boosting machines. It targets machine learning engineers, researchers, and practitioners working with structured data, offering a significant aid for understanding model behavior and debugging. The primary benefit is enhanced model interpretability through detailed, educational visualizations.
How It Works
dtreeviz employs a visualization approach inspired by educational animations, utilizing an adaptor pattern (dtreeviz.model()) to extract necessary information from various decision tree implementations. This allows for a unified interface across supported libraries including scikit-learn, XGBoost, Spark MLlib, LightGBM, and TensorFlow. A key advantage is its ability to generate detailed visualizations of prediction paths, leaf node information, feature spaces, and classifier decision boundaries, offering deep insights into model logic.
Quick Start & Requirements
Installation is primarily via pip: pip install dtreeviz. Additional dependencies for specific libraries can be installed using extras, e.g., pip install dtreeviz[xgboost]. For AI chat features, install with pip install dtreeviz[ai] and set the OPENAI_API_KEY environment variable. Python version 3.6+ is required. A critical prerequisite is the Graphviz binary, with specific installation instructions provided for Mac (using Homebrew), Linux (Ubuntu: sudo apt install graphviz), and Windows (downloading MSI and updating PATH). Links to example notebooks for various supported libraries are available.
Highlighted Details
dtreeviz.decision_boundaries() function extends beyond tree models, working with any classifier supporting predict_proba().Maintenance & Community
The project was initiated by Terence Parr, with significant contributions from Tudor Lapusan, Prince Grover, and Matthew Epland. Feedback and feature requests are welcomed via email or GitHub issues.
Licensing & Compatibility
The project is licensed under the permissive MIT license, allowing for broad compatibility with commercial and closed-source applications.
Limitations & Caveats
Currently, only SVG file output is supported. Jupyter Notebooks may exhibit rendering issues with SVGs due to a known bug, while Jupyter Lab displays them correctly. Platform-specific setup for the Graphviz binary can be complex. Internet Explorer is not recommended for viewing generated SVG files.
1 week ago
Inactive
merrymercy
Shengjia Zhao(Chief Scientist at Meta Superintelligence Lab),
google
grahamjenson
ThilinaRajapakse
google-research
triton-inference-server
tensorflow
visenger