Python警告:D:\Python3\lib\site-packages\sklearn\cross_validation.py:41: 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)
解决办法:将from sklearn.cross_validation import train_test_split改为from sklearn.model_selection import train_test_split

本文解决了Python中使用sklearn进行交叉验证时出现的弃用警告问题。从0.18版本开始,sklearn已将cross_validation模块迁移到model_selection模块,并计划在0.20版本中移除旧模块。解决方法是更新导入语句,将from sklearn.cross_validation import train_test_split更改为from sklearn.model_selection import train_test_split。
1918

被折叠的 条评论
为什么被折叠?



