Error cannot import " from sklearn.ensemble import forest"

I was running notebooks of ML course

Got Following error when running fowwing
"
from fastai.structured import *
"
----> 1 from sklearn.ensemble import forest

ImportError: cannot import name ‘forest’ from ‘sklearn.ensemble’ (/usr/local/anaconda3/envs/fastai/lib/python3.7/site-packages/sklearn/ensemble/init.py)

So I went through modules names in github using following this

Solution

forest is renamed as _forest

So I changed the line 5 in. structure.py file

from sklearn.ensemble import _forest as forest

Hope this will solve problem

1 Like

Solution

forest is renamed as _forest

So I changed the line 5 in. structure.py file

from sklearn.ensemble import _forest as forest

Hope this will solve problem