RandomForestClassifier import

2019-08-11 08:49发布

I've installed Anaconda Python distribution with scikit-learn. While importing RandomForestClassifier:

from sklearn.ensemble import RandomForestClassifier

I have the following error:

File "C:\Anaconda\lib\site-packages\sklearn\tree\tree.py", line 36, in <module> from . import _tree ImportError: cannot import name _tree

What the problem can be there?

2条回答
老娘就宠你
2楼-- · 2019-08-11 09:46

The problem was that I had the 64bit version of Anaconda and the 32bit sklearn.

查看更多
甜甜的少女心
3楼-- · 2019-08-11 09:48

In sklearn version '0.18.1'

from sklearn.ensemble.forest import RandomForestClassifier

查看更多
登录 后发表回答