A Decision Tree Visualization Packages.
Project description
A Decision Tree Visualization Packages.
import dtreeplot package model_plot function
from dtreeplot import model_plot
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier
X, y = datasets.make_classification(n_samples=30000, n_features=10, weights=[0.96, 0.04])
features = [f'Var{i+1}' for i in range(X.shape[1])]
clf = DecisionTreeClassifier(criterion='gini',
max_depth=3,
min_samples_split=30,
min_samples_leaf=10,
random_state=1234)
model = clf.fit(X, y)
# visualize tree model
model_plot(model, features, labels=y, height=530)
pip3 install dtreeplot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
dtreeplot-0.1.1-py3-none-any.whl
(98.7 kB
view hashes)
Close
Hashes for dtreeplot-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b03f4c687275a5859dbdd44b1265ca2f903c2ef2dfcc0e3e9b19ceefc96ff194 |
|
MD5 | 7abb499f1770f4994eb573cee8bf1717 |
|
BLAKE2b-256 | 825db8c2a1a58f03f2a7493692f2850078759417063523ef0689f5218dc306b4 |