ValueError:输入形状错误

时间:2019-07-29 17:48:59

标签: python scikit-learn svm valueerror

  

ValueError跟踪(最近一次通话最后一次)

我收到此错误:

  

ValueError:输入形状错误(1323,7)

我正在使用SVC(kernel ='linear')

from sklearn.model_selection import train_test_split
xTrainx, xTestx, yTrainy, yTesty = train_test_split(X, y, 
test_size = 0.25, random_state = 42)

xTrainx.shape
(1323, 909)
yTrainy.shape
(1323, 7)
xTestx.shape
(441, 909)
yTesty.shape
(441, 7)


model = SVC(kernel='linear')
model.fit(xTrainx, yTrainy)
print("SVC:", model.score(xTestx, yTesty))
ValueError: bad input shape (1323, 7)

0 个答案:

没有答案