你能帮我解决这个问题吗?
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)发布于 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 --我们将不得不取代它的未来:
from sklearn.cross_validation import KFold通过以下方式:
from sklearn.model_selection import KFold对于我在您发布的屏幕截图中看到的第二个错误,SA3L module似乎没有安装。
发布于 2019-07-04 02:41:08
现在已经不再推荐使用cross_validation,而是使用model_selection,但是所有的方法和类都是相同的。现在只需导入:
from sklearn import model_selection为了训练和测试数据,你必须这样做:
x_train,x_test,y_train,y_test=model_selection.train_test_split(x,y,test_size=0.2)https://stackoverflow.com/questions/45009249
复制相似问题