Skip to main content

Python package treeplot vizualizes a tree based on a randomforest or xgboost model.

Project description

treeplot

Python PyPI Version License Downloads Donate

  • treeplot is Python package

Contents

Installation

  • Install treeplot from PyPI (recommended). treeplot is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
  • It is distributed under the MIT license.

Quick Start

pip install treeplot
  • Alternatively, install treeplot from the GitHub source:
git clone https://github.com/erdogant/treeplot.git
cd treeplot
python setup.py install

Import treeplot package

import treeplot

Example RandomForest:

# Load example dataset
X,y = treeplot.import_example()
# Learn model
model = RandomForestClassifier(n_estimators=100, max_depth=2, random_state=0).fit(X, y)
# Make plot
ax = treeplot.plot(model)

# or alternatively if you have more parameters to specify:
ax = treeplot.randomforest(model, export='pdf')

Example XGboost:

# Load example dataset
X,y = treeplot.import_example()
# Learn model
model = XGBClassifier(n_estimators=100, max_depth=2, random_state=0).fit(X, y)
# Make plot
ax = treeplot.plot(model)

# or alternatively if you have more parameters to specify:
ax = treeplot.xgboost(model, plottype='vertical')

Maintainers

Contribute

  • Contributions are welcome.

Licence

See LICENSE for details.

Donation

  • This work is created and maintained in my free time. Contributions of any kind are very appreciated. Sponsering is also possible.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treeplot-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

treeplot-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file treeplot-0.1.1.tar.gz.

File metadata

  • Download URL: treeplot-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.10

File hashes

Hashes for treeplot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5d09ffeedde900aad0a31e6da1a41b03815ebbc9e9843813838a69cd0e858097
MD5 6008bd00cb8184aee0193d0f3b8fd93f
BLAKE2b-256 75442d2bb2ca3a478c25c86c68dfa8d19c6c46c5d3d5b0c8f0f588ba6398ced6

See more details on using hashes here.

File details

Details for the file treeplot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: treeplot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.10

File hashes

Hashes for treeplot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18eff57ec24c0e019e4ae93bcfc8e2c3a27a8368bf34183ba9df7ef7fc66382c
MD5 ecb6d0e6ad8788fc773cd52d40bf0bb8
BLAKE2b-256 925833e009b858e9187b13993c45e25a70ba171eadb9c8325c22cb778e6cdf54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page