博客
关于我
准确率评价指标
阅读量: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/

你可能感兴趣的文章
NN&DL4.3 Getting your matrix dimensions right
查看>>
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>