原来:
from sklearn.cross_validation import train_test_split
运行报错:
修改:
将sklearn.cross_validation修改成sklearn.model_selection
from sklearn.model_selection import train_test_split
from sklearn.cross_validation import train_test_split
from sklearn.model_selection import train_test_split
train_test_split
已被cross_validation
被废弃了,sklearn.model_selection
中调用train_test_split
函数可以解决此问题。