RandomForestClassifier import

你离开我真会死。 提交于 2019-12-13 16:36:17

问题


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?


回答1:


In sklearn version '0.18.1'

from sklearn.ensemble.forest import RandomForestClassifier




回答2:


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



来源:https://stackoverflow.com/questions/29735766/randomforestclassifier-import

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!