Tencent / NeuralNLP-NeuralClassifier

An Open-source Neural Hierarchical Multi-label Text Classification Toolkit
Other
1.85k stars 406 forks source link

多分类问题,evaluate计算precision recall方式是不是有些问题 #37

Closed llplay closed 4 years ago

llplay commented 4 years ago

classification_evaluate.py 中注意到下面这几行代码,对于单标签的多分类问题predict_total和standard_total的值是不是一直都相等?计算出的precision和recall也是相等的,这样的指标好像没有太大意义

(precision_dict[self.MICRO_AVERAGE], recall_dict[self.MICRO_AVERAGE], fscore_dict[self.MICRO_AVERAGE]) = \ self._calculate_prf(right_total, predict_total, standard_total) return precision_dict, recall_dict, fscore_dict

liqunhit commented 4 years ago

微平均(Micro-average)的计算指标逻辑,precision和recall确实是相同的,这个不是错误,是微平均定义本身就是这样的。

ZhichaoOuyang commented 4 years ago

同问,感觉计算出来的precision和recall一直都是相等,有点懵逼