TypeError:不能将Singleton数组(0.2)视为有效的集合。
X = df.iloc[:, [1,7]].values
y= df.iloc[:,-1].values
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, 0.2)
我在尝试训练时遇到这个错误。我能用X和y值训练我的模型。不过,我想分割我的数据帧,然后训练和测试它。
如有任何帮助,我们将不胜感激。
目前没有回答
相关问题 更多 >
编程相关推荐