oegedijk / explainerdashboard

Quickly build Explainable AI dashboards that show the inner workings of so-called "blackbox" machine learning models.
http://explainerdashboard.readthedocs.io
MIT License
2.31k stars 332 forks source link

ImportError 'dtreeviz' while import from explainerdashboard #255

Closed hadoop-cloud closed 1 year ago

hadoop-cloud commented 1 year ago

Hi Community,

I am learning explainability techniques, i found this very promising open source package. I am facing an issue while i does an import .

Any help here would be really great

from explainerdashboard import ClassifierExplainer, RegressionExplainer

`--------------------------------------------------------------------------- ImportError Traceback (most recent call last)

in () 1 from sklearn.ensemble import RandomForestClassifier 2 # from explainerdashboard.datasets import titanic_survive ----> 3 from explainerdashboard import ClassifierExplainer, RegressionExplainer /home/user/.local/lib/python3.6/site-packages/explainerdashboard/__init__.py in () 2 ___version__ = "0.3.8.2" 3 ----> 4 from .explainers import ClassifierExplainer, RegressionExplainer 5 from .dashboards import ExplainerDashboard, ExplainerHub, InlineExplainer /home/user/.local/lib/python3.6/site-packages/explainerdashboard/explainers.py in () 25 import shap 26 ---> 27 from dtreeviz.trees import ShadowDecTree, dtreeviz 28 29 from sklearn.model_selection import KFold ImportError: cannot import name 'dtreeviz'`
hadoop-cloud commented 1 year ago

i think there is no dtreeviz module inside dtreeviz

ifails here from dtreeviz.trees import ShadowDecTree, dtreeviz

hadoop-cloud commented 1 year ago

this imports works fine in google colab, but it doesn't works on jupyter instance.

from dtreeviz.trees import ShadowDecTree, dtreeviz

MinaKanak commented 1 year ago

I'm having the same issue with cloudera platform: from explainerdashboard import ClassifierExplainer, ExplainerDashboard ImportError: cannot import name 'dtreeviz' ImportError Traceback (most recent call last) in engine ----> 1 from explainerdashboard import ClassifierExplainer, ExplainerDashboard

/home/cdsw/.local/lib/python3.6/site-packages/explainerdashboard/init.py in () 2 _version = "0.3.8.2" 3 ----> 4 from .explainers import ClassifierExplainer, RegressionExplainer 5 from .dashboards import ExplainerDashboard, ExplainerHub, InlineExplainer

/home/cdsw/.local/lib/python3.6/site-packages/explainerdashboard/explainers.py in () 25 import shap 26 ---> 27 from dtreeviz.trees import ShadowDecTree, dtreeviz 28 29 from sklearn.model_selection import KFold

ImportError: cannot import name 'dtreeviz'

AkshayRShiraguppi commented 1 year ago

This usually has to do with dependent libraries. I'd try upgrading or downgrading shap/dtreeviz to fix it.

Also check https://github.com/oegedijk/explainerdashboard/issues/253#issue-1573799601

oegedijk commented 1 year ago

Hi, this should be fixed in the latest released version (0.4.2) could you confirm?

hadoop-cloud commented 1 year ago

Yes, it seems that it worked on Colab notebook. but my jupyter instance still shows the same error. Not sure may be due to env issues. Thanks for your reply.