精确/召回多类多标签分类 [英] Precision/recall for multiclass-multilabel classification

查看:493
本文介绍了精确/召回多类多标签分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何为多类多标签分类(即具有两个以上标签且每个实例可以有多个标签的分类)计算精度和召回率?

I'm wondering how to calculate precision and recall measures for multiclass multilabel classification, i.e. classification where there are more than two labels, and where each instance can have multiple labels?

推荐答案

对于多标签分类,您有两种方法 首先考虑以下内容.

For multi-label classification you have two ways to go First consider the following.

  • 是示例数.
  • 是示例.
  • 是示例.
  • 是示例.

以每个数据点的方式计算指标.对于每个预测的标签,只计算其得分,然后将这些得分汇总到所有数据点上.

The metrics are computed in a per datapoint manner. For each predicted label its only its score is computed, and then these scores are aggregated over all the datapoints.

  • 精度= ,预测的正确率之比.分子找出预测向量中有多少个标签与基本事实有共同点,并且比率计算实际有多少个预测真实标签在基本事实中.
  • 召回= ,预测了多少实际标签的比率.分子找出预测向量中有多少个标签与地面实数有共同点(如上所述),然后求出与实际标签数的比率,从而得到预测的实际标签的比例.
  • Precision = , The ratio of how much of the predicted is correct. The numerator finds how many labels in the predicted vector has common with the ground truth, and the ratio computes, how many of the predicted true labels are actually in the ground truth.
  • Recall = , The ratio of how many of the actual labels were predicted. The numerator finds how many labels in the predicted vector has common with the ground truth (as above), then finds the ratio to the number of actual labels, therefore getting what fraction of the actual labels were predicted.

还有其他指标.

在这里,事情是按照标签进行的.对于每个标签,计算指标(例如,精度,召回率),然后将这些基于标签的指标进行汇总.因此,在这种情况下,您最终需要像对二进制分类(因为每个标签都有一个二进制赋值)那样,对整个数据集的每个标签计算精度/召回率,然后对其进行汇总.

Here the things are done labels-wise. For each label the metrics (eg. precision, recall) are computed and then these label-wise metrics are aggregated. Hence, in this case you end up computing the precision/recall for each label over the entire dataset, as you do for a binary classification (as each label has a binary assignment), then aggregate it.

简单的方法是呈现一般形式.

The easy way is to present the general form.

这只是标准多类等效项的扩展.

This is just an extension of the standard multi-class equivalent.

  • 宏平均

  • Macro averaged

微观平均

此处分别是真正的正数,错误的正数,真正的负数和错误的负数 label .

Here the are the true positive, false positive, true negative and false negative counts respectively for only the label.

此处$ B $代表任何基于混淆矩阵的度量.在您的情况下,您可以插入标准精度并调用公式.对于宏平均值,请传递每个标签的计数,然后求和;对于微观平均值,请先对计数进行平均,然后应用度量函数.

Here $B$ stands for any of the confusion-matrix based metric. In your case you would plug in the standard precision and recall formulas. For macro average you pass in the per label count and then sum, for micro average you average the counts first, then apply your metric function.

您可能有兴趣查看多标签指标的代码 mldr R 中.另外,您可能有兴趣研究Java多标签库 MULAN .

You might be interested to have a look into the code for the mult-label metrics here , which a part of the package mldr in R. Also you might be interested to look into the Java multi-label library MULAN.

这是一篇介绍不同指标的好论文:关于多标签学习算法的评论

This is a nice paper to get into the different metrics: A Review on Multi-Label Learning Algorithms

这篇关于精确/召回多类多标签分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆