treeplot


Nametreeplot JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://erdogant.github.io//treeplot
SummaryPython package treeplot vizualizes a tree based on a randomforest or xgboost model.
upload_time2024-10-11 11:45:56
maintainerNone
docs_urlNone
authorErdogan Taskesen
requires_python>=3
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # treeplot - Plot tree based machine learning models.

[![Python](https://img.shields.io/pypi/pyversions/treeplot)](https://img.shields.io/pypi/pyversions/treeplot)
[![PyPI Version](https://img.shields.io/pypi/v/treeplot)](https://pypi.org/project/treeplot/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/erdogant/treeplot/blob/master/LICENSE)
[![Downloads](https://pepy.tech/badge/treeplot)](https://pepy.tech/project/treeplot)
[![Downloads](https://pepy.tech/badge/treeplot/month)](https://pepy.tech/project/treeplot/month)
[![BuyMeCoffee](https://img.shields.io/badge/buymea-coffee-yellow.svg)](https://www.buymeacoffee.com/erdogant)
[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/treeplot/)
<!---[![Coffee](https://img.shields.io/badge/coffee-black-grey.svg)](https://erdogant.github.io/donate/?currency=USD&amount=5)-->

* ``treeplot`` is 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

```bash
pip install treeplot
```

#### Import treeplot package

```python
import treeplot as tree
```
# 


### [Documentation pages](https://erdogant.github.io/treeplot/)

On the [documentation pages](https://erdogant.github.io/treeplot/) you can find detailed information about the working of the ``treeplot`` with examples. 

<hr> 

### Examples

# 

* [Example: RandomForest](https://erdogant.github.io/treeplot/pages/html/Examples.html#)

<p align="left">
  <a href="https://erdogant.github.io/treeplot/pages/html/Examples.html#">
  <img src="https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_randomforest.png" width="600" />
  </a>
</p>


# 

* [Example: XGboot](https://erdogant.github.io/treeplot/pages/html/Examples.html#xgboost)

<p align="left">
  <a href="https://erdogant.github.io/treeplot/pages/html/Examples.html#xgboost">
  <img src="https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_xgboot_tree.png" width="600" />
   <br>
  <img src="https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_xgboot_weights.png" width="600" />
  </a>
</p>


# 
* [Example: gradientboostingclassifier](https://erdogant.github.io/treeplot/pages/html/Examples.html#gradientboostingclassifier)
# 
* [Example: lightbm](https://erdogant.github.io/treeplot/pages/html/Examples.html#lightbm)
# 
* [Example: Explore other trees such as second best tree etc](https://erdogant.github.io/treeplot/pages/html/Examples.html#plot-second-best-tree-and-other-trees)

<hr>

#### Maintainers
* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)

#### Contribute
* Contributions are welcome.
* If you wish to buy me a <a href="https://www.buymeacoffee.com/erdogant">Coffee</a> for this work, it is very appreciated :)


            

Raw data

            {
    "_id": null,
    "home_page": "https://erdogant.github.io//treeplot",
    "name": "treeplot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": null,
    "author": "Erdogan Taskesen",
    "author_email": "erdogant@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d5/c6/a660973c93dc682202b8f4b2c3a9a93a4db61ae73807d13abc0849327eeb/treeplot-0.2.0.tar.gz",
    "platform": null,
    "description": "# treeplot - Plot tree based machine learning models.\r\n\r\n[![Python](https://img.shields.io/pypi/pyversions/treeplot)](https://img.shields.io/pypi/pyversions/treeplot)\r\n[![PyPI Version](https://img.shields.io/pypi/v/treeplot)](https://pypi.org/project/treeplot/)\r\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/erdogant/treeplot/blob/master/LICENSE)\r\n[![Downloads](https://pepy.tech/badge/treeplot)](https://pepy.tech/project/treeplot)\r\n[![Downloads](https://pepy.tech/badge/treeplot/month)](https://pepy.tech/project/treeplot/month)\r\n[![BuyMeCoffee](https://img.shields.io/badge/buymea-coffee-yellow.svg)](https://www.buymeacoffee.com/erdogant)\r\n[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/treeplot/)\r\n<!---[![Coffee](https://img.shields.io/badge/coffee-black-grey.svg)](https://erdogant.github.io/donate/?currency=USD&amount=5)-->\r\n\r\n* ``treeplot`` is Python package to easily plot the tree derived from models such as decisiontrees, randomforest and xgboost.\r\nDeveloping 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 \ud83c\udf32. 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.\r\n\r\n### Functions in treeplot\r\n\r\nTreeplot can plot the tree for Random-forest, decission trees, xgboost and gradient boosting models:\r\n  * .plot         : Generic function to plot the tree of any of the four models with default settings\r\n  * .randomforest : Plot the randomforest model. Parameters can be specified.\r\n  * .xgboost      : Plot the xgboost model. Parameters can be specified.\r\n  * .import_example('iris') : Import example dataset\r\n\r\n# \r\n**\u2b50\ufe0f Star this repo if you like it \u2b50\ufe0f**\r\n#\r\n\r\n#### Install treeplot from PyPI\r\n\r\n```bash\r\npip install treeplot\r\n```\r\n\r\n#### Import treeplot package\r\n\r\n```python\r\nimport treeplot as tree\r\n```\r\n# \r\n\r\n\r\n### [Documentation pages](https://erdogant.github.io/treeplot/)\r\n\r\nOn the [documentation pages](https://erdogant.github.io/treeplot/) you can find detailed information about the working of the ``treeplot`` with examples. \r\n\r\n<hr> \r\n\r\n### Examples\r\n\r\n# \r\n\r\n* [Example: RandomForest](https://erdogant.github.io/treeplot/pages/html/Examples.html#)\r\n\r\n<p align=\"left\">\r\n  <a href=\"https://erdogant.github.io/treeplot/pages/html/Examples.html#\">\r\n  <img src=\"https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_randomforest.png\" width=\"600\" />\r\n  </a>\r\n</p>\r\n\r\n\r\n# \r\n\r\n* [Example: XGboot](https://erdogant.github.io/treeplot/pages/html/Examples.html#xgboost)\r\n\r\n<p align=\"left\">\r\n  <a href=\"https://erdogant.github.io/treeplot/pages/html/Examples.html#xgboost\">\r\n  <img src=\"https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_xgboot_tree.png\" width=\"600\" />\r\n   <br>\r\n  <img src=\"https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_xgboot_weights.png\" width=\"600\" />\r\n  </a>\r\n</p>\r\n\r\n\r\n# \r\n* [Example: gradientboostingclassifier](https://erdogant.github.io/treeplot/pages/html/Examples.html#gradientboostingclassifier)\r\n# \r\n* [Example: lightbm](https://erdogant.github.io/treeplot/pages/html/Examples.html#lightbm)\r\n# \r\n* [Example: Explore other trees such as second best tree etc](https://erdogant.github.io/treeplot/pages/html/Examples.html#plot-second-best-tree-and-other-trees)\r\n\r\n<hr>\r\n\r\n#### Maintainers\r\n* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)\r\n\r\n#### Contribute\r\n* Contributions are welcome.\r\n* If you wish to buy me a <a href=\"https://www.buymeacoffee.com/erdogant\">Coffee</a> for this work, it is very appreciated :)\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python package treeplot vizualizes a tree based on a randomforest or xgboost model.",
    "version": "0.2.0",
    "project_urls": {
        "Download": "https://github.com/erdogant/treeplot/archive/0.2.0.tar.gz",
        "Homepage": "https://erdogant.github.io//treeplot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ab086f662e9344cf543ef15628ba6c75e5e0f5b7b9b79a17b2e401c809a3573",
                "md5": "7f7a5ee6511ee0e678e70e7076a673b8",
                "sha256": "fa715a59f62e49d4f5e6c102a9034608f61e83d9af76e291370d9b2fac0cfd01"
            },
            "downloads": -1,
            "filename": "treeplot-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f7a5ee6511ee0e678e70e7076a673b8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 7914,
            "upload_time": "2024-10-11T11:45:55",
            "upload_time_iso_8601": "2024-10-11T11:45:55.000478Z",
            "url": "https://files.pythonhosted.org/packages/4a/b0/86f662e9344cf543ef15628ba6c75e5e0f5b7b9b79a17b2e401c809a3573/treeplot-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5c6a660973c93dc682202b8f4b2c3a9a93a4db61ae73807d13abc0849327eeb",
                "md5": "30a5a0fdc15b60eb791fae3f28802465",
                "sha256": "72ecce5b49809f0b56cc144661dfe2e87e902958b7a4556da9b52b5d8b3c8a59"
            },
            "downloads": -1,
            "filename": "treeplot-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "30a5a0fdc15b60eb791fae3f28802465",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 8808,
            "upload_time": "2024-10-11T11:45:56",
            "upload_time_iso_8601": "2024-10-11T11:45:56.049313Z",
            "url": "https://files.pythonhosted.org/packages/d5/c6/a660973c93dc682202b8f4b2c3a9a93a4db61ae73807d13abc0849327eeb/treeplot-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-11 11:45:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "erdogant",
    "github_project": "treeplot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "treeplot"
}
        
Elapsed time: 0.50013s