博客
关于我
准确率评价指标
阅读量:258 次
发布时间:2019-03-01

本文共 1013 字,大约阅读时间需要 3 分钟。

一、top1和top5

在分类任务中,top1和top5是两种常见的预测方式:

top1-即为预测的label取最后概率向量中最大的一个作为预测结果。如果正确分类,则预测正确;否则预测错误。

top5-则是最后概率向量中最大的前五名,只要包含正确的label即为预测正确;若正确label不在前五名,则预测错误。

二、Precision、Recall和Accuracy

2.1 Precision和Recall

在信息检索场景中,系统返回查询结果会出现以下几种情况:

1. **True Positive (TP)**:系统正确识别了用户需求的相关结果。

2. **False Positive (FP)**:系统误将无关结果归类为相关。

3. **False Negative (FN)**:系统漏掉了正确的相关结果。

4. **Gray Area**:系统识别出的结果本身就是无关内容。

precision(精确率)衡量系统返回的结果中有多少是正确的,即TP/(TP+FP)。Recall(召回率)则衡量系统返回的结果中有多少是相关的,即TP/(TP+FN)。两个指标相辅相成,单独提升一项可能导致另一项下降。

为什么不用准确率(accuracy)?因为准确率在样本不平衡时容易受到偏差。在大部分信息检索任务中,大部分结果都是无关的,使用准确率会导致结果失真。

2.2 为什么不用准确率(accuracy)

准确率的计算公式为:(TP + TN)/N,其中N为总样本数。虽然在平衡样本下准确率有用,但在实际应用中数据通常不平衡,导致准确率容易被误导。例如,在信息检索中,大部分结果无关,系统更倾向于优化召回率和精确率的平衡。

二、mAP(mean average precision)

在多标签分类任务中,mAP(mean average precision)是评估模型性能的常用指标。与单标签分类的accuracy不同,mAP考虑了多个标签的检测结果。

mAP的计算步骤如下:

1. 使用训练好的模型生成所有测试样本的confidence score,并记录每个样本的ground truth标签。

2. 按照confidence score对结果进行排序。

3. 计算每个类别的precision和recall,并取平均值。

mAP不仅考虑了每个样本的分类结果,还综合了所有类别的性能评估,适合多标签场景下的性能衡量。

转载地址:http://uctx.baihongyu.com/

你可能感兴趣的文章
SSM(Spring+SpringMvc+Mybatis)整合开发笔记
查看>>
ViewHolder的改进写法
查看>>
Orderer节点启动报错解决方案:Not bootstrapping because of 3 existing channels
查看>>
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement profile
查看>>
sql查询中 查询字段数据类型 int 与 String 出现问题
查看>>
org.apache.commons.beanutils.BasicDynaBean cannot be cast to ...
查看>>
org.apache.dubbo.common.serialize.SerializationException: com.alibaba.fastjson2.JSONException: not s
查看>>
sqlserver学习笔记(三)—— 为数据库添加新的用户
查看>>
org.apache.http.conn.HttpHostConnectException: Connection to refused
查看>>
org.apache.ibatis.binding.BindingException: Invalid bound statement错误一例
查看>>
org.apache.ibatis.exceptions.PersistenceException:
查看>>
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned
查看>>
org.apache.ibatis.type.TypeException: Could not resolve type alias 'xxxx'异常
查看>>
org.apache.poi.hssf.util.Region
查看>>
org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
查看>>
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
查看>>
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugManifest'
查看>>
org.hibernate.HibernateException: Unable to get the default Bean Validation factory
查看>>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
查看>>
org.springframework.amqp.AmqpConnectException:java.net.ConnectException:Connection timed out:connect
查看>>