[英]AttributeError: type object 'sklearn.tree._tree.TreeBuilder' has no attribute '__reduce_cython__'
[英]AttributeError: type object 'sklearn.tree._criterion.array' has no attribute '__reduce_cython__'
我想from sklearn.tree import DecisionTreeRegressor
在 jupyter 中from sklearn.tree import DecisionTreeRegressor
。 但是當我只運行包含上面導入的行時,我收到了這個錯誤。
<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__'
我嘗試通過 conda 安裝 scipy 並更新 scikit-learn,但沒有解決。
嘗試更新 Cython :
pip install cython
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.