当我想用来sklearn.model_selection.train_test_split拆分训练集和测试集时,它会引发如下错误:
AttributeError: module 'sklearn' has no attribute 'model_selection'
我的代码如下:
import pandas as pd
import sklearn
data = pd.read_csv('SpeedVideoDataforModeling.csv',header=0,)
data_x = data.iloc[:,1:4]
data_y = data.iloc[:,4:]
x_train , x_test, y_train, y_test =
sklearn.model_selection.train_test_split(data_x,data_y,test_size = 0.2)
在 Pycharm 中,scikit-learn 包版本为 0.19.1。 在此处输入图片描述 感谢您的帮助!
慕侠2389804
噜噜哒
相关分类