Radial dendrogram visualization for hierarchical clustering with feature importance overlays
Project description
📊 radiatreepp
RadialTree++ is a Python package for generating radial dendrograms from hierarchical clustering output, with rich visual overlays for SHAP-style feature importances, semantic rings, and custom annotations.
🚀 Features
- 📐 Radial dendrograms for hierarchical clustering (via SciPy)
- 🎨 Gradient edge coloring (e.g., by average depth or SHAP value)
- 🧠 Semantic ring overlays to display feature groups or categories
- 🔤 Flexible label layout (radial or horizontal)
- 🔘 Node highlighting options (e.g., only inner merges, or top N)
- 🧩 Easy to integrate with any feature importance method (XGBoost, TabNet, etc.)
📦 Installation
pip install radiatreepp
Or clone locally and install in editable mode:
git clone git@github.com:es15326/radialtreepp.git
cd radiatreepp
pip install -e .
🧪 Demo Examples
To generate the plots from the included synthetic dataset:
python -m radiatreepp.examples.xgboost_demo log_feature_importance_synthetic.csv
python -m radiatreepp.examples.tabnet_demo log_feature_importance_synthetic.csv
Each command generates:
out_figs/radial_dendrogram_<model>.pngout_figs/radial_dendrogram_<model>_legend.png
🔧 Customization
You can fully control the look and behavior via the RadialTreeConfig class:
from radiatreepp import RadialTreeConfig
config = RadialTreeConfig(
fontsize=8,
radial_labels=False,
label_radius=1.2,
node_display_mode='inner', # all, inner, none
node_label_display_mode='top_3', # all, inner, top_3, none
node_size=5,
node_label_fontsize=7,
gradient_colors=["black", "blue"], # colormap for edge gradient
colorlabels={"Category": color_array}, # optional outer rings
)
📁 File Structure
radiatreepp/
├── core.py # Main plotting logic
├── config.py # Dataclass for RadialTreeConfig
├── utils.py # Helper for dendrogram computation
├── __init__.py
examples/
├── xgboost_demo.py
├── tabnet_demo.py
log_feature_importance_synthetic.csv # Safe-to-publish example CSV
📘 Input CSV Format
Your input file should have at least:
Feature: Feature namesXGBoost,TabNet, ...: Importance valuesCategory: For outer ring color labels
Example:
Feature,Category,XGBoost,TabNet
Feature_0,Category_1,0.134,0.112
Feature_1,Category_2,0.984,0.803
...
🧠 Applications
- Interpreting SHAP values from models like XGBoost, TabNet, LightGBM
- Explaining hierarchical clusters with group semantics
- Publishing visualizations for papers, dashboards, and reports
✍️ Author
Elham Soltani Kazemi
University of Missouri
GitHub Profile
📜 License
MIT License — free for personal, academic, and commercial use.
❤️ Acknowledgments
Inspired by SHAP visualization, SciPy’s dendrograms, and feature importance research in explainable AI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file radiatreepp-0.1.0.tar.gz.
File metadata
- Download URL: radiatreepp-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
309e4fa19f9ede7c9bab29a44f1f10d71d87b3cca5ac1d5a7da039413e46167c
|
|
| MD5 |
b0b46f52e0b0ea18310316636640dda9
|
|
| BLAKE2b-256 |
9d4a4c485342e85a2c34946ff63b53839272e17bff4218a259b997c508e91843
|
File details
Details for the file radiatreepp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: radiatreepp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
320672f877648216ad057511c564d7531646a9271f73d5b85585149b73300cbf
|
|
| MD5 |
671226226e2494d0c84e2510b0fb35bf
|
|
| BLAKE2b-256 |
2d62662b0141e102385894f6f88fac1deac5cca13028fb985dc29e7176b23c48
|