首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AttributeError:类型对象'sklearn.tree._criterion.array‘没有特性'__reduce_cython__’

AttributeError:类型对象'sklearn.tree._criterion.array‘没有特性'__reduce_cython__’
EN

Stack Overflow用户
提问于 2019-12-12 04:15:29
回答 1查看 934关注 0票数 1

我想在jupyter中导入from sklearn.tree import DecisionTreeRegressor。但是,当我运行只包含上面的import行时,我得到了这个错误。

代码语言:javascript
复制
<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__'

我试着安装scipy并更新scikit-learn by conda,但是没有解决。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-12 04:34:44

尝试更新Cython:

代码语言:javascript
复制
pip install cython
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59293402

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档