在我网站上的用户生成的帖子下,我有一个类似亚马逊的评级系统:
Was this review helpful to you: Yes | No
如果有投票,我会在该行上方显示结果,如下所示:
5 of 8 people found this reply helpful.
我想根据这些排名对帖子进行排序。如果您按照从最有帮助到最没有帮助的顺序进行排名,您会如何排列以下帖子?
a) 1/1 = 100% helpful
b) 2/2 = 100% helpful
c) 999/1000 = 99.9% helpful
b) 3/4 = 75% helpful
e) 299/400 = 74.8% helpful
显然,仅根据有用百分比进行排序是不对的,应该以某种方式将总票数考虑在内。是否有标准方法可以做到这一点?
UPDATE:
使用 Charles 公式计算 Agresti-Coull 下限并对其进行排序,以上示例的排序方式如下:
1) 999/1000 (99.9%) = 95% likely to fall in 'helpfulness' range of 99.2% to 100%
2) 299/400 (74.8%) = 95% likely to fall in 'helpfulness' range of 69.6% to 79.3%
3) 3/4 (75%) = 95% likely to fall in 'helpfulness' range of 24.7% to 97.5%
4) 2/2 (100%) = 95% likely to fall in 'helpfulness' range of 23.7% to 100%
5) 1/1 (100%) = 95% likely to fall in 'helpfulness' range of 13.3% to 100%
直觉上,这感觉是对的。
UPDATE 2:
从应用程序的角度来看,我不想每次提取帖子列表时都运行这些计算。我想我要么按照定期的、cron 驱动的计划更新和存储 Agresti-Coull 下限(仅更新自上次运行以来收到投票的帖子),要么在收到新投票时更新它。
对于每篇文章,请设定您期望它有多大帮助的界限。我更喜欢使用 Agresti-Coull 间隔。伪代码:
float AgrestiCoullLower(int n, int k) {
//float conf = 0.05; // 95% confidence interval
float kappa = 2.24140273; // In general, kappa = ierfc(conf/2)*sqrt(2)
float kest=k+kappa^2/2;
float nest=n+kappa^2;
float pest=kest/nest;
float radius=kappa*sqrt(pest*(1-pest)/nest);
return max(0,pest-radius); // Lower bound
// Upper bound is min(1,pest+radius)
}
然后取估计值的下限并对其进行排序。因此,2/2(由 Agresti-Coull 提出)有 95% 的可能性落在 23.7% 到 100% 的“有用性”范围内,因此它低于 999/1000,其范围为 99.2% 到 100%(因为 0.237
编辑:由于有些人似乎发现这很有帮助(哈哈),所以我要注意的是,可以根据您想要的自信/规避风险程度来调整算法。您需要的信心越少,您就越愿意放弃“经过验证”(高票)的评论,而选择未经测试但高分的评论。 90% 置信区间得出的 kappa = 1.95996398,85% 置信区间得出的结果为 1.78046434,75% 置信区间得出的结果为 1.53412054,完全谨慎的 50% 置信区间得出的结果为 1.15034938。
50% 置信区间给出
1) 999/1000 (99.7%) = 50% likely to fall in 'helpfulness' range of 99.7% to 100%
2) 299/400 (72.2%) = 50% likely to fall in 'helpfulness' range of 72.2% to 77.2%
3) 2/2 (54.9%) = 50% likely to fall in 'helpfulness' range of 54.9% to 100%
4) 3/4 (45.7%) = 50% likely to fall in 'helpfulness' range of 45.7% to 91.9%
5) 1/1 (37.5%) = 50% likely to fall in 'helpfulness' range of 37.5% to 100%
总体来说并没有什么不同,但它确实更喜欢 2/2 而不是 3/4 的安全性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)