Skip to content

Commit 3df384b

Browse files
authored
Update README.md
1 parent fa1b2ca commit 3df384b

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

README.md

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,58 @@
66
[![Downloads](https://pepy.tech/badge/treeplot)](https://pepy.tech/project/treeplot)
77
[![Downloads](https://pepy.tech/badge/treeplot/month)](https://pepy.tech/project/treeplot/month)
88
[![BuyMeCoffee](https://img.shields.io/badge/buymea-coffee-yellow.svg)](https://www.buymeacoffee.com/erdogant)
9+
[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/treeplot/)
910
<!---[![Coffee](https://img.shields.io/badge/coffee-black-grey.svg)](https://erdogant.github.io/donate/?currency=USD&amount=5)-->
1011

1112
* ``treeplot`` is Python package to easily plot the tree derived from models such as decisiontrees, randomforest and xgboost.
1213
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.
1314

14-
#
15-
**Star this repo if you like it! ⭐️**
16-
#
17-
1815
### Functions in treeplot
1916

2017
Treeplot can plot the tree for Random-forest, decission trees, xgboost and gradient boosting models:
21-
* treeplot.plot() : Generic function to plot the tree of any of the four models with default settings
22-
* treeplot.randomforest() : Plot the randomforest model. Parameters can be specified.
23-
* treeplot.xgboost() : Plot the xgboost model. Parameters can be specified.
24-
* treeplot.import_example('iris') : Import example dataset
18+
* .plot : Generic function to plot the tree of any of the four models with default settings
19+
* .randomforest : Plot the randomforest model. Parameters can be specified.
20+
* .xgboost : Plot the xgboost model. Parameters can be specified.
21+
* .import_example('iris') : Import example dataset
22+
23+
#
24+
**⭐️ Star this repo if you like it ⭐️**
25+
#
2526

26-
### Installation
27-
* Install treeplot from PyPI (recommended). treeplot is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
28-
* It is distributed under the MIT license.
27+
#### Install treeplot from PyPI
2928

30-
#### Quick Start
31-
```
29+
```bash
3230
pip install treeplot
3331
```
3432

35-
3633
#### Import treeplot package
37-
```python
38-
import treeplot
39-
```
4034

41-
### Example RandomForest:
4235
```python
43-
# Load example dataset
44-
X,y = treeplot.import_example()
45-
# Learn model
46-
from sklearn.ensemble import RandomForestClassifier
47-
model = RandomForestClassifier(n_estimators=100, max_depth=2, random_state=0).fit(X, y)
36+
import treeplot as tree
4837
```
38+
#
4939

50-
```python
51-
# Make plot
52-
ax = treeplot.plot(model)
53-
# or directly
54-
ax = treeplot.randomforest(model)
55-
```
56-
<p align="center">
40+
41+
### [Documentation pages](https://erdogant.github.io/treeplot/)
42+
43+
On the [documentation pages](https://erdogant.github.io/treeplot/) you can find detailed information about the working of the ``treeplot`` with examples.
44+
45+
<hr>
46+
47+
### Examples
48+
49+
#
50+
51+
* [Example: RandomForest](https://erdogant.github.io/treeplot/pages/html/Examples.html#)
52+
53+
<p align="left">
54+
<a href="https://erdogant.github.io/treeplot/pages/html/Examples.html#">
5755
<img src="https://github.com/erdogant/treeplot/blob/master/docs/figs/Figure_1.png" width="550" />
56+
</a>
5857
</p>
5958

60-
```python
61-
# If more parameters needs to be specified, use the exact function:
62-
ax = treeplot.randomforest(model, export='pdf')
63-
```
59+
60+
#
6461

6562
#### Example XGboost:
6663
```python

0 commit comments

Comments
 (0)