当我使用 10 折交叉验证运行此处理时,预测结果与标签数据完全相反,我得到零准确度。我无法解决为什么会这样?
kfold = model_selection.KFold(n_splits=5,random_state=+7,shuffle=False)
predictions = model_selection.cross_val_predict(SVC(),features_list,labels_list,cv=kfold)
accuracy=metrics.accuracy_score(labels_list,predictions)
print(confusion_matrix(labels_list,predictions))
print(classification_report(labels_list,predictions))
print("Accuracy Score:",accuracy)