{"id":17464999,"url":"https://github.com/erdogant/treeplot","last_synced_at":"2026-02-26T20:02:51.430Z","repository":{"id":55861341,"uuid":"245515375","full_name":"erdogant/treeplot","owner":"erdogant","description":"Plot tree based machine learning models","archived":false,"fork":false,"pushed_at":"2024-10-11T11:45:48.000Z","size":32985,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T16:48:43.523Z","etag":null,"topics":["gradient-boosting","machine-learning","plot","pypi","python","randomforest","tree-structure","treeplot","xgboost"],"latest_commit_sha":null,"homepage":"https://erdogant.github.io/treeplot","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erdogant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["erdogant"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-03-06T20:58:53.000Z","updated_at":"2024-12-30T22:24:53.000Z","dependencies_parsed_at":"2023-01-19T06:45:56.227Z","dependency_job_id":"5209ec06-0173-4076-85ac-04baa5bfe2a0","html_url":"https://github.com/erdogant/treeplot","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/erdogant/treeplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Ftreeplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Ftreeplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Ftreeplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Ftreeplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdogant","download_url":"https://codeload.github.com/erdogant/treeplot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Ftreeplot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265483449,"owners_count":23774210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gradient-boosting","machine-learning","plot","pypi","python","randomforest","tree-structure","treeplot","xgboost"],"created_at":"2024-10-18T11:08:17.605Z","updated_at":"2026-02-26T20:02:51.381Z","avatar_url":"https://github.com/erdogant.png","language":"Python","funding_links":["https://github.com/sponsors/erdogant","https://www.buymeacoffee.com/erdogant"],"categories":[],"sub_categories":[],"readme":"# treeplot - Plot tree based machine learning models.\n\n[![Python](https://img.shields.io/pypi/pyversions/treeplot)](https://img.shields.io/pypi/pyversions/treeplot)\n[![PyPI Version](https://img.shields.io/pypi/v/treeplot)](https://pypi.org/project/treeplot/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/erdogant/treeplot/blob/master/LICENSE)\n[![Downloads](https://pepy.tech/badge/treeplot)](https://pepy.tech/project/treeplot)\n[![Downloads](https://pepy.tech/badge/treeplot/month)](https://pepy.tech/project/treeplot/month)\n[![BuyMeCoffee](https://img.shields.io/badge/buymea-coffee-yellow.svg)](https://www.buymeacoffee.com/erdogant)\n[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/treeplot/)\n\u003c!---[![Coffee](https://img.shields.io/badge/coffee-black-grey.svg)](https://erdogant.github.io/donate/?currency=USD\u0026amount=5)--\u003e\n\n* ``treeplot`` is Python package to easily plot the tree derived from models such as decisiontrees, randomforest and xgboost.\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 🌲. 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.\n\n### Functions in treeplot\n\nTreeplot can plot the tree for Random-forest, decission trees, xgboost and gradient boosting models:\n  * .plot         : Generic function to plot the tree of any of the four models with default settings\n  * .randomforest : Plot the randomforest model. Parameters can be specified.\n  * .xgboost      : Plot the xgboost model. Parameters can be specified.\n  * .import_example('iris') : Import example dataset\n\n# \n**⭐️ Star this repo if you like it ⭐️**\n#\n\n#### Install treeplot from PyPI\n\n```bash\npip install treeplot\n```\n\n#### Import treeplot package\n\n```python\nimport treeplot as tree\n```\n# \n\n\n### [Documentation pages](https://erdogant.github.io/treeplot/)\n\nOn the [documentation pages](https://erdogant.github.io/treeplot/) you can find detailed information about the working of the ``treeplot`` with examples. \n\n\u003chr\u003e \n\n### Examples\n\n# \n\n* [Example: RandomForest](https://erdogant.github.io/treeplot/pages/html/Examples.html#)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://erdogant.github.io/treeplot/pages/html/Examples.html#\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_randomforest.png\" width=\"600\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n# \n\n* [Example: XGboot](https://erdogant.github.io/treeplot/pages/html/Examples.html#xgboost)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://erdogant.github.io/treeplot/pages/html/Examples.html#xgboost\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_xgboot_tree.png\" width=\"600\" /\u003e\n   \u003cbr\u003e\n  \u003cimg src=\"https://github.com/erdogant/treeplot/blob/master/docs/figs/fig_breast_xgboot_weights.png\" width=\"600\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n# \n* [Example: gradientboostingclassifier](https://erdogant.github.io/treeplot/pages/html/Examples.html#gradientboostingclassifier)\n# \n* [Example: lightbm](https://erdogant.github.io/treeplot/pages/html/Examples.html#lightbm)\n# \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)\n\n\u003chr\u003e\n\n#### Maintainers\n* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)\n\n#### Contribute\n* Contributions are welcome.\n* If you wish to buy me a \u003ca href=\"https://www.buymeacoffee.com/erdogant\"\u003eCoffee\u003c/a\u003e for this work, it is very appreciated :)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdogant%2Ftreeplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdogant%2Ftreeplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdogant%2Ftreeplot/lists"}