mAP的一点理解

mAP:全称mean average precision(平均准确率),信息检索中常用的评价指标(可参考 信息检索的评价指标(Precision, Recall, F-score, MAP) )。

每一次检索结果的好坏通过AP(average precision)来衡量,mAP则为多次检索,取其平均值。

AP的计算

摘自:https://www.kaggle.com/wiki/MeanAveragePrecision

the average precision at n for this user is:

ap@n=k=1nP(k)/min(m,n)

where P(k) means the precision at cut-off k in the item list, i.e., the ratio of number of recommended nodes followed, up to the position k, over the number k; P(k) equals 0 when the k-th item is not followed upon recommendation; m is the number of relevant nodes; n is the number of predicted nodes. If the denominator is zero, P(k)/min(m,n) is set to zero.

n可以理解为检索时前n个最相关匹配项,即top-n。P(K)表示前 k(k = 1,2, … ,n)项中,设与查询对象groundtruth一致的匹配项个数为x,则 P(k)=xk 。如果 第 k 项的groundtruth不匹配,P(k)即为0。 分母中m表示数据库中总的与检索对象groundtruth一致的数目,一般的m是远大于n的。比如说一种情况:数据库中总共与xx查询相关的对象只有3(m=3)个,当然前10(n=10)个相关项中最多只有3个正确匹配项,如果还将分母设为10的话,当然错了。

具体应用

假设有两个主题,主题1有4个相关网页,主题2有5个相关网页。某系统对于主题1检索出4个相关网页,其rank分别为1, 2, 4, 7;对于主题2检索出3个相关网页,其rank分别为1,3,5。
这里取top-10(注意 m < n):
对于主题1,平均准确率为 (1/1+2/2+3/4+4/7)/4=0.83
对于主题 2,平均准确率为 (1/1+2/3+3/5)/5=0.45
mAP@10=(0.83+0.45)/2=0.64

知乎上的一张图片:
这里写图片描述

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值