ImportError: unable to import name Bunch scikit-learn 0.19

I am trying to create a Pipeline using sklearn.pipeline using Jupyter: Anaconda 4.3.24, python 2.7 .

from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_recall_fscore_support
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.pipeline import Pipeline
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import SelectFromModel
from collections import defaultdict
from pprint import pprint

But I get an error related to the utils directory as shown below:

ImportError: Unable to import Bunch name:

ImportError: cannot import name Bunch

Also, when I comment on a line

from sklearn.pipeline import Pipeline

I again get the error related to the utils directory in the following line:

ImportError: cannot import name euler_gamma

Can someone point me in the right direction?

+4
source share
1 answer

update your scikit-learn

pip install scikit-learn --upgrade
+3

Source: https://habr.com/ru/post/1684012/


All Articles