使用python时的警告消息

Dha*_*ara 10 python svm python-2.7

我在运行SVM python代码时不断得到这个:

Warning (from warnings module):
  File "/usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py", line 44
    "This module will be removed in 0.20.", DeprecationWarning)
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.

Warning (from warnings module):
  File "/usr/local/lib/python2.7/dist-packages/sklearn/grid_search.py", line 43
    DeprecationWarning)
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. This module will be removed in 0.20.
Run Code Online (Sandbox Code Playgroud)

这条警告信息表示什么?

提前致谢

Sam*_*mar 28

scikit-learn的最新稳定版本是0.18 http://scikit-learn.org/stable/

您使用的版本已弃用这些模块.
或者使用

    from sklearn.model_selection import train_test_split
Run Code Online (Sandbox Code Playgroud)

看看这个讨论
https://github.com/rhiever/tpot/issues/284
和这个评论:https:
//github.com/rhiever/tpot/commit/84c5e26b447251088826737612ccf0817ef43db2

  • 它不是下一个弃用模块的版本,模块已经在当前版本(版本0.18)中弃用.不推荐使用意味着不再维护模块,通常支持替代或更好的实践.在这种情况下,开发人员表示将在版本0.20中删除cross_validation. (2认同)