无法绘制学习曲线正确使用mlxtend

时间:2019-11-08 04:08:51

标签: machine-learning

我尝试使用mlxtend软件包(http://rasbt.github.io/mlxtend/user_guide/plotting/plot_learning_curves/)绘制机器学习学习曲线。但是,我收到此错误:

ValueError: Unable to coerce to Series, length must be 1: given 10

有人知道会发生什么吗?这是我的代码:

clf = SVC(kernel='poly',degree=3)
scoring = 'accuracy'
score = cross_val_score(clf, x_train, y_train,
                        cv=k_fold, n_jobs=1, scoring=scoring)
print(score)
clf.fit(x_train, y_train)
pred = clf.predict(x_test)
print(pred)
print(classification_report(y_test, pred))

plot_learning_curves(x_train, y_train, x_test, y_test, clf)
plt.show()

0 个答案:

没有答案