treeplot - Plot tree based machine learning models.
treeplotis Python package to easily plot the tree derived from models such as decisiontrees, randomforest and xgboost. Developing explainable machine learning models is becoming more important in many domains. The most popular and classical explainable models are still tree based. Think of decision trees or random forest. The tree that is learned can be visualized and then explained. However, it can be a challange to simply plot the tree. Think of configuration issues with dot files, path locations to graphviz, differences across operating systems, differences across editors such as jupyter notebook, colab, spyder etc. This frustration led to this library, an easy way to plot the decision trees 🌲. It works for Random-forest, decission trees, xgboost and gradient boosting models. Under the hood it makes many checks, downloads graphviz, sets the path and then plots the tree.
Functions in treeplot
Treeplot can plot the tree for Random-forest, decission trees, xgboost and gradient boosting models:
- .plot : Generic function to plot the tree of any of the four models with default settings
- .randomforest : Plot the randomforest model. Parameters can be specified.
- .xgboost : Plot the xgboost model. Parameters can be specified.
- .import_example('iris') : Import example dataset
⭐️ Star this repo if you like it ⭐️
Install treeplot from PyPI
pip install treeplot
Import treeplot package
import treeplot as tree
Documentation pages
On the documentation pages you can find detailed information about the working of the treeplot with examples.
Examples
Maintainers
- Erdogan Taskesen, github: erdogant
Contribute
- Contributions are welcome.
- If you wish to buy me a Coffee for this work, it is very appreciated :)
Metadata
Release files for treeplot 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| treeplot-0.2.0.tar.gz | 8.8 kB | Without provenance | Details for treeplot-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| treeplot-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for treeplot-0.2.0-py3-none-any.whl |
Total release size: 16.7 kB
Release files / treeplot-0.2.0.tar.gz
| Download URL | treeplot-0.2.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72ecce5b49809f0b56cc144661dfe2e87e902958b7a4556da9b52b5d8b3c8a59
|
|
BLAKE2b-256 checksum How to use checksums |
d5c6a660973c93dc682202b8f4b2c3a9a93a4db61ae73807d13abc0849327eeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / treeplot-0.2.0-py3-none-any.whl
| Download URL | treeplot-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa715a59f62e49d4f5e6c102a9034608f61e83d9af76e291370d9b2fac0cfd01
|
|
BLAKE2b-256 checksum How to use checksums |
4ab086f662e9344cf543ef15628ba6c75e5e0f5b7b9b79a17b2e401c809a3573
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for treeplot 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.