AttributeError: type object ‘sklearn.tree._criterion.array’ has no attribute ‘__reduce_cython__’

我想在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

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注