sklearn cross_validation 过时问题解决

网上看的有些教程比较老,有跑起来报如下错误的:
/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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
即可

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注