首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DeprecationWarning机器学习

DeprecationWarning机器学习
EN

Stack Overflow用户
提问于 2017-07-10 10:06:47
回答 2查看 5.2K关注 0票数 2

你能帮我解决这个问题吗?

代码语言:javascript
复制
C:\Python27\lib\site-packages\sklearn\cross_validation.py:44‌: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also, note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20. "This module will be removed in 0.20.", DeprecationWarning)
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-07-10 10:31:24

这个

C:\Python27\lib\site-packages\sklearn\cross_validation.py:44‌: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also, note that the interface of the new CV iterators is different from that of this module. This module will be removed in 0.20. "This module will be removed in 0.20.", DeprecationWarning)

只是一个降级警告

不必担心,但请记住,cross_val将在0.20中删除。

此错误只是警告您,开发人员将在执行此功能之前移动该函数。

只是一个example.In --我们将不得不取代它的未来:

代码语言:javascript
复制
from sklearn.cross_validation import KFold

通过以下方式:

代码语言:javascript
复制
 from sklearn.model_selection import KFold

对于我在您发布的屏幕截图中看到的第二个错误SA3L module似乎没有安装。

票数 6
EN

Stack Overflow用户

发布于 2019-07-04 02:41:08

现在已经不再推荐使用cross_validation,而是使用model_selection,但是所有的方法和类都是相同的。现在只需导入:

代码语言:javascript
复制
from sklearn import model_selection

为了训练和测试数据,你必须这样做:

代码语言:javascript
复制
x_train,x_test,y_train,y_test=model_selection.train_test_split(x,y,test_size=0.2)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45009249

复制
相关文章

相似问题

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