RandomForestClassifier import

Question:

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

from sklearn.ensemble import RandomForestClassifier

I have the following error:

File "C:Anacondalibsite-packagessklearntreetree.py", line 36, in <module>
from . import _tree
ImportError: cannot import name _tree

What the problem can be there?

Asked By: Ilya Zinkovich

||

Answers:

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

Answered By: Ilya Zinkovich

In sklearn version ‘0.18.1’

from sklearn.ensemble.forest import RandomForestClassifier
Answered By: Raj Damani

I solved it by:

pip install -U scikit-learn

Answered By: William