scikit-learn-contrib / hiclass

A python library for hierarchical classification compatible with scikit-learn
BSD 3-Clause "New" or "Revised" License
114 stars 20 forks source link

Can't find the "Explainer" for hiclass #123

Closed RamSnoussi closed 6 months ago

RamSnoussi commented 6 months ago

Hi, I can't find the Explainer for hiclass. what's the problem?

from hiclass import Explainer
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[5], line 1
----> 1 from hiclass import Explainer

ImportError: cannot import name 'Explainer' from 'hiclass' (/home/anaconda3/lib/python3.9/site-packages/hiclass/__init__.py)

hiclass: 3.0.3 python: 3.9 conda: 24.4.0

mirand863 commented 6 months ago

Hi @RamSnoussi,

I believe you already fixed the problem. But for posterity, the explainer class only started to get introduced in the library in version 4.8.0 for the local classifier per parent node, while the latest version 4.10.0 should have this implemented for all 3 local hierarchical classifiers. It is still experimental and will probably have updates in the near future. @ashishpatel16 @dniprocat If you have trouble installing a specific version of the library, it could be related to some incompatibility with the python version you have installed in your system, though in theory it should be compatible according to our tests. I suggest trying different python versions in your system, e.g., 3.8 or 3.10.