Open HarshKapadia opened 1 year ago
Hmm...must be an old version of dtreeviz?
this is my package details
Name: dtreeviz Version: 2.0.0 Summary: A Python 3 library for sci-kit learn, XGBoost, LightGBM, Spark, and TensorFlow decision tree visualization Home-page: https://github.com/parrt/dtreeviz Author: Terence Parr, Tudor Lapusan, and Prince Grover Author-email: parrt@antlr.org License: MIT Location: c:\users\UserName\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages Requires: colour, graphviz, matplotlib, numpy, pandas, pytest, scikit-learn Required-by:
@HarshKapadia I suspect it's an import issue. Please double check there, because your code sees the dtreeviz as a function, as it was in the old version of the library.
Maybe this could help also : https://stackoverflow.com/questions/75346507/dtreeviz-nameerror
If you followed all the above suggestions and still no success, providing a collab notebook or some sharable code to reproduce the issue would help us :)
I am also having the same issue while trying to visualize a representative tree of xgboost classifier. AttributeError Traceback (most recent call last)
I am facing this issue while visualizing a decision tree using dtreeviz . I follow your demo of sklearn from READ.md. I am using vscode and download jupyter notebook as extension.
this is what I got after executing it
AttributeError Traceback (most recent call last) Cell In[37], line 1 ----> 1 viz_model = dtreeviz.model(tree_classifier, 2 X_train=dataset[features], y_train=dataset[target], 3 feature_names=features, 4 target_name=target, class_names=["perish", "survive"])
AttributeError: 'function' object has no attribute 'model'