TypeError:SVM中“ tuple”和“ int”的实例之间不支持“ <”

时间:2020-10-19 16:26:45

标签: machine-learning svm svc

我试图在LinearSVC中测试不同参数C的效果并将其绘制出来。我使用了以下代码:

scores=[]
X_train, X_test, y_train, y_test = train_test_split(SNPs_df, SNPs_class, test_size=0.33)
for this_C in zip([0.00001, 100]):
  model = LinearSVC(C=this_C)
  model.fit(X_train,y_train)
  scores.append(model.score(X_test, y_test))

plt.plot(this_C, np.mean(scores), 'bo')
plt.xlabel('Training set proportion (%)')
plt.ylabel('accuracy');

但我收到此错误:

TypeError: '<' not supported between instances of 'tuple' and 'int'  

你能帮我吗?我找不到我犯错的地方。

0 个答案:

没有答案