sklearn.learning_curve 和 cross_validation 0.18版本废弃警告及解决方法

D:\ProgramData\Anaconda3\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.

在0.18版本中不推荐使用此模块,而是支持所有重构的类和函数移动到的model_selection模块。 另请注意,新CV迭代器的接口与此模块的接口不同。 该模块将在0.20版本中删除。

主要意思 :  主要意思是说在0.18版本中,cross_validation被废弃了,在 0.20版本中,将被删除

解决办法:

 from sklearn.learning_curve import learning_curve 修改为: from sklearn.model_selection import learning_curve

即 从  model_selection 中导入  learning_curve 模块

猜你喜欢

转载自blog.csdn.net/xrinosvip/article/details/81842242