
treemind, a high-performance Python library for interpreting tree-based models.
Whether you're auditing models, debugging feature behavior, or exploring feature interactions, treemind provides a robust and scalable solution with meaningful visual explanations.
- Feature Analysis Understand how individual features influence model predictions across different split intervals.
- Interaction etection Automatically detect and rank pairwise or higher-order feature interactions.
- Model Support Works seamlessly with LightGBM, XGBoost, CatBoost, scikit-learn, and perpetual.
- Performance Optimized Fast even on deep and wide ensembles via Cython-backed internals.
- Visualizations Includes a plotting module for interaction maps, importance heatmaps, feature influence charts, and more.
Installation
pip install treemind
One-imensional Feature Explanation
Each row in the table shows how the model behaves within a specific range of the selected feature.
The value column represents the average prediction in that interval, making it easier to identify which value ranges influence the model most.
| worst_texture_lb | worst_texture_ub | value | std | count |
|------------------|------------------|-----------|----------|---------|
| -inf | 18.460 | 3.185128 | 8.479232 | 402.24 |
| 18.460 | 19.300 | 3.160656 | 8.519873 | 402.39 |
| 19.300 | 19.415 | 3.119814 | 8.489262 | 401.85 |
| 19.415 | 20.225 | 3.101601 | 8.490439 | 402.55 |
| 20.225 | 20.360 | 2.772929 | 8.711773 | 433.16 |
Feature Plot
Two imensional Interaction Plot
The plot shows how the model's prediction varies across value combinations of two features. It highlights regions where their joint influence is strongest, revealing important interactions.
Learn More
- ocumentation: https://treemind.readthedocs.io
- Github: https://github.com/sametcopur/treemind/
- Algorithm etails: How It Works
- Benchmarks: Performance Evaluation
Feedback and contributions are welcome. If you're working on model interpretability, we'd love to hear your thoughts.