sklearn中的这两个类有什么区别?

时间:2018-07-14 11:29:28

标签: python scikit-learn

sklearn.model_selection.train_test_split
sklearn.cross_validation.train_test_split

我相信这两种方法都是将训练和测试集分开进行的,但是两者之间有什么区别?

1 个答案:

答案 0 :(得分:-1)

这两者之间的区别是

唯一需要注意的是,在 0.20 版本的sklearn中,sklearn.cross_validation.train_test_split 已弃用

from sklearn.cross_validation import train_test_split

/anaconda2/lib/python2.7/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)