Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'dtreeviz' has no attribute 'model' on Windows platform, works fine on Google colab #311

Open
sabya39 opened this issue Nov 30, 2023 · 0 comments

Comments

@sabya39
Copy link

sabya39 commented Nov 30, 2023

Getting AttributeError: module 'dtreeviz' has no attribute 'model' when executing the README code below

from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier

import dtreeviz

iris = load_iris()
X = iris.data
y = iris.target

clf = DecisionTreeClassifier(max_depth=4)
clf.fit(X, y)

viz_model = dtreeviz.model(clf,
X_train=X, y_train=y,
feature_names=iris.feature_names,
target_name='iris',
class_names=iris.target_names)

v = viz_model.view() # render as SVG into internal object
v.show() # pop up window
v.save("/tmp/iris.svg") # optionally save as svg
In a notebook, you can render inline without calling show(). Just call view():

viz_model.view() # in notebook, displays inline

@sabya39 sabya39 changed the title AttributeError: module 'dtreeviz' has no attribute 'model' AttributeError: module 'dtreeviz' has no attribute 'model' on Windows platform, works fine on Google colab Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant