gpt4 book ai didi

machine-learning - 了解 Precision@K、AP@K、MAP@K

转载 作者:行者123 更新时间:2023-11-30 08:51:55 30 4
gpt4 key购买 nike

我目前正在评估基于隐式反馈的推荐系统。我对排名任务的评估指标有点困惑。具体来说,我希望通过精确度和召回率来进行评估。

Precision@k has the advantage of not requiring any estimate of the size of the set of relevant documents but the disadvantages that it is the least stable of the commonly used evaluation measures and that it does not average well, since the total number of relevant documents for a query has a strong influence on precision at k

我自己注意到它往往非常不稳定,因此,我想对多个评估日志的结果进行平均。

我想知道;假设我运行一个返回以下数组的评估函数:

Numpy array containing precision@k scores for each user.

现在我有了一个包含数据集中所有 precision@3 分数的数组。

如果我取这个数组的平均值,并平均 20 个不同的分数:这是否等于 Mean Average Precision@KMAP@K 还是我理解这个有点太字面意思了?

我正在写一篇带有评估部分的论文,因此定义的准确性对我来说非常重要。

最佳答案

涉及两个平均值,这使得这些概念在某种程度上变得模糊,但它们非常简单 - 至少在 resys 上下文中 - 让我澄清一下:

P@K

How many relevant items are present in the top-k recommendations of your system


例如,要计算 P@3:获取给定用户的前 3 个推荐,并检查其中有多少是好的推荐。该数字除以 3 得出 P@3

AP@K

The mean of P@i for i=1, ..., K.


例如,要计算 AP@3:将 P@1、P@2 和 P@3 相加,然后将该值除以 3

AP@K 通常是针对一个用户计算的。

MAP@K

The mean of the AP@K for all the users.


例如,要计算 MAP@3:将所有用户的 AP@3 相加,然后将该值除以用户数量

如果你是程序员,可以查看this code ,它是 Kaggle CTO 维护的库 ml_metricsapkmapk 函数的实现。

希望对您有帮助!

关于machine-learning - 了解 Precision@K、AP@K、MAP@K,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55748792/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com