from sklearn.metrics import classification_report y_true=[0,1,2,2,2]#真值 y_pred=[0,0,2,2,1]#预测结果 print(classification_report(y_true,y_pred))