当我从sklearn库导入算法时,我收到一条错误消息 - ImportError:无法导入名称'bincount'。我从来没有遇到过这个错误,在这里找不到相应的答案。请帮忙
import sklearn
sklearn.__version__
Out[1]:
'0.19.1'
from sklearn.ensemble import RandomForestClassifier
输出错误
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-4a3086242da3> in <module>()
3 import matplotlib.pyplot as plt
4 get_ipython().magic('matplotlib inline')
----> 5 from sklearn.ensemble import RandomForestClassifier
C:\Users\30295\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\ensemble\__init__.py in <module>()
5
6 from .base import BaseEnsemble
----> 7 from .forest import RandomForestClassifier
8 from .forest import RandomForestRegressor
9 from .forest import RandomTreesEmbedding
C:\Users\30295\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\ensemble\forest.py in <module>()
55 from ..externals.joblib import Parallel, delayed
56 from ..externals import six
---> 57 from ..metrics import r2_score
58 from ..preprocessing import OneHotEncoder
59 from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor,
C:\Users\30295\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\metrics\__init__.py in <module>()
5
6
----> 7 from .ranking import auc
8 from .ranking import average_precision_score
9 from .ranking import coverage_error
C:\Users\30295\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\metrics\ranking.py in <module>()
30 from ..utils.multiclass import type_of_target
31 from ..utils.extmath import stable_cumsum
---> 32 from ..utils.sparsefuncs import count_nonzero
33 from ..exceptions import UndefinedMetricWarning
34 from ..preprocessing import LabelBinarizer
C:\Users\30295\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\utils\sparsefuncs.py in <module>()
7 import numpy as np
8
----> 9 from .fixes import sparse_min_max, bincount
10 from .sparsefuncs_fast import (
11 csr_mean_variance_axis0 as _csr_mean_var_axis0,
ImportError: cannot import name 'bincount'