classification_report进阶:针对top-k的结果计算precision@k、recall@k、f1-score@k
sklearn自带的classification_report方法可以针对二分类或多分类问题,计算分类器的precision、recall和f1-score。示例:fromsklearn.metricsimportclassification_reporty_true=[0,1,2,2,0]y_pred=[1,0,2,1,1]print(classification_report(y_true,y