[英]AttributeError: type object 'sklearn.tree._criterion.array' has no attribute '__reduce_cython__'
I want to import from sklearn.tree import DecisionTreeRegressor
in jupyter.我想from sklearn.tree import DecisionTreeRegressor
在 jupyter 中from sklearn.tree import DecisionTreeRegressor
。 but when I run just the line contains above import, I got this error.但是当我只运行包含上面导入的行时,我收到了这个错误。
<ipython-input-16-28b3e81cd98d> in <module>
----> 1 from sklearn.tree import DecisionTreeRegressor
~/.local/lib/python3.6/site-packages/sklearn/tree/__init__.py in <module>
4 """
5
----> 6 from ._classes import BaseDecisionTree
7 from ._classes import DecisionTreeClassifier
8 from ._classes import DecisionTreeRegressor
~/.local/lib/python3.6/site-packages/sklearn/tree/_classes.py in <module>
38 from ..utils.validation import check_is_fitted
39
---> 40 from ._criterion import Criterion
41 from ._splitter import Splitter
42 from ._tree import DepthFirstTreeBuilder
~/.local/lib/python3.6/site-packages/sklearn/tree/_criterion.cpython-36m-x86_64-linux-gnu.so in init sklearn.tree._criterion()
AttributeError: type object 'sklearn.tree._criterion.array' has no attribute '__reduce_cython__'
I tried to install scipy and update scikit-learn by conda but it didn't solved.我尝试通过 conda 安装 scipy 并更新 scikit-learn,但没有解决。
尝试更新 Cython :
pip install cython
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.