andosa/treeinterpreter

Python 3.6 + sklearn 0.24

Closed this issue · 2 comments

fsan commented

Hello.
I am receiving this error with

tree interpreter version '0.1.0' and sklearn0.24.0

just after doing
from treeinterpreter import treeinterpreter as ti

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-729-679b5145dca2> in <module>
----> 1 from treeinterpreter import treeinterpreter as ti
      2 from sklearn.tree import DecisionTreeRegressor
      3 from sklearn.ensemble import RandomForestRegressor

~/miniconda3/envs/py36_ds_liv/lib/python3.6/site-packages/treeinterpreter/treeinterpreter.py in <module>
      3 import sklearn
      4 
----> 5 from sklearn.ensemble.forest import ForestClassifier, ForestRegressor
      6 from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier, _tree
      7 from distutils.version import LooseVersion

ModuleNotFoundError: No module named 'sklearn.ensemble.forest'

There is already a fix for that in merge request #30, and that was merged into master, but there hasn't been a release containing that yet.

If that's an option for you, just building this library from source would solve this issue for you. Otherwise you'll have to wait for a release to be made. I already created an issue asking the maintainer if they could do one in #37

fsan commented

Thank you very much.
I've made a local patch but the solution was just too ugly and I didnt had time yet to improve, so I didn't try to submit.
I will try to build it from source as soon as possible.
anyway, as you are aware of this I think we may close this issue as it is a duplicate.

Thanks once more!