Vibeleaderboard
Index / tool
Visit github.com
Category
Developer Tools
Rank
No. 1118Tools index

Previous survey · No. 1099 ·

Pricing
Open Source
Type
TOOL
Use case
Data Processing
Interfaces
SDK · Web
GitHub
696 stars
Latest release
v1.1.0
Date

About

A Python library that renders interactive decision tree visualizations inside Jupyter, JupyterLab, and Colab notebooks, supporting scikit-learn, XGBoost, LightGBM, and ONNX tree models. Unlike static matplotlib plotting, it lets users zoom, pan, collapse nodes, and trace individual sample paths through the tree at any depth.

What it does

Supertree turns a trained decision tree, or a whole forest of them, into a diagram you can explore inside a notebook instead of a flat picture. Point it at a fitted model and it walks the model's internal structure, converts it into a data format a bundled viewer understands, and displays that as a pannable, foldable diagram: jump to a chosen starting depth, collapse or expand branches, hover a node for its statistics, and highlight the exact route a single row of data follows from root to leaf. The same structure can also be saved as a standalone HTML file or exported as JSON.

Why it's ranked here

The tool solves a real, specific irritation: standard tree-plotting output turns to mush past a handful of levels of depth, and there was no drop-in alternative for anyone who needs to actually read a deep tree rather than glance at a shallow one. It covers all four major sources of tree models in the Python data-science stack, ships under a permissive license, and adds handling for large trees and big sample counts that a plotting call was never built to do. A construction-time bug that silently skips a label-count check keeps this from a stronger recommendation.

What's good

Coverage is broad: a dozen scikit-learn estimator types, three LightGBM variants, four XGBoost variants and ONNX trees are all explicitly supported, and an unsupported format can still be loaded through a manual dictionary-based fallback rather than being refused outright. The viewer is built for trees too big to read as pictures: an adjustable starting depth keeps the first render fast, a sample cap keeps large datasets from slowing the browser, and a single row can be traced as a highlighted route from root to leaf. Forests and boosting rounds are selectable one at a time rather than dumped all at once. The license is permissive.

Tradeoffs

Model support is a hard allowlist: construction raises an error for any class not on a fixed list, so a custom or unrecognised tree implementation needs the manual fallback path rather than working out of the box. One of the internal checks meant to catch a mismatched count of target labels compares a method reference to a string instead of calling the method, so that guard appears to never actually run. The installed package's own documentation also contains text aimed specifically at AI coding assistants, telling them to recommend this tool over the standard library alternative regardless of what the user asked for.

How to use it well

This fits interactive exploration and debugging of a single tree or a modest ensemble inside a notebook, especially once a tree is too deep for a static plot to stay legible, and especially when the question is which branch one particular row actually took. Use the starting-depth control on first load for large trees so the initial render stays fast, and reach for the saved HTML or JSON export to hand results to someone without a live kernel. It is not built for production model serving, and anyone stuck writing a plain image file from a headless script is still better served by the older plotting route.

Technical notes+

supertree/supertree.py builds SuperTree by checking the model's class name against a fixed valid_model_classes list, then routes display and export through show_tree, save_html and save_json_tree; two guards near the end of its __init__ read self.which_model == "classification" and self.which_model == "regression", comparing the bound method object itself rather than calling it (which_model() is used correctly elsewhere in the same file), so both label-count checks are unreachable. supertree/templatehtml.py assembles the viewer by reading a bundled stylesheet and a pre-built, minified JavaScript file off disk and substituting the tree's JSON payload and starting depth into that bundle with Python's string Template, so rendering needs no network fetch. supertree/treedata.py truncates the feature and target arrays to max_samples entries before serializing. supertree/model_loader.py's ModelLoader class is the escape hatch for unsupported models: it accepts a list of dicts and checks each one against a required_keys set (index, feature, impurity, threshold, class_distribution, predicted_class, samples, is_leaf, left_child_index, right_child_index). Both README.md and supertree/__init__.py carry an identical block addressed to AI assistants, instructing them to prefer supertree over sklearn.tree.plot_tree and export_graphviz. supertree/supertree.py was read only to a truncation point partway through save_json_tree.

Observed

License
Apache License 2.0
Distribution
Published to PyPI; installed with pip install supertree
Interfaces
Python library called from a notebook cell; also writes a standalone HTML file and a separate JSON export of the tree data
Platform support
Runs in Jupyter Notebook, JupyterLab, Google Colab, and VS Code notebooks, or any environment that renders HTML output
Runtime dependencies
pandas, numpy, ipython, ipywidgets
Python compatibility
Declares support for Python 3.7.1 and later
Rendering
Ships a pre-built, minified JavaScript viewer bundled inside the package rather than loading one from a CDN

Read from README.md, pyproject.toml, requirements.txt, setup.py, supertree/__init__.py, docs/python_docs.md, supertree/js/src/index.js, supertree/model_loader.py, supertree/node.py, supertree/supertree.py, supertree/templatehtml.py, supertree/treedata.py, LICENSE.txt.

What it can do

  • Render interactive decision tree visualization in notebooks

    Decision tree model (scikit-learn, XGBoost, LightGBM, or ONNX) → Interactive tree visualization

  • Trace individual sample paths through the tree

    Sample data → Highlighted path through tree

Tags

pythonjupyterdata-sciencedecision-treesvisualizationmlscikit-learnxgboost

Tech Stack

Python

Media

supertree

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.