我该如何订购这些"有用"的分数?

mit*_*chf 6 math statistics comments voting user-generated-content

在我网站上用户生成的帖子下,我有一个类似亚马逊的评级系统:

   Was this review helpful to you: Yes | No
Run Code Online (Sandbox Code Playgroud)

如果有投票,我会在上面显示结果,如下所示:

   5 of 8 people found this reply helpful.
Run Code Online (Sandbox Code Playgroud)

我想根据这些排名对帖子进行排序.如果您从最有帮助到最不实用的排名,您将如何订购以下帖子?

   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
Run Code Online (Sandbox Code Playgroud)

显然,它不能仅对有用的百分比进行排序,不知何故应该考虑总票数.是否有一种标准的方法可以做到这一点?

更新:

使用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%
Run Code Online (Sandbox Code Playgroud)

直观地说,这感觉很对.

更新2:

从应用程序的角度来看,我不希望每次提取帖子列表时都运行这些计算.我想我会以常规的,由cron驱动的时间表更新和存储Agresti-Coull下限(仅更新自上次运行以来收到投票的那些帖子),或者每当收到新的投票时更新它.

Cha*_*les 5

对于每个帖子,生成有关您期望它的有用程度的界限.我更喜欢使用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)
}
Run Code Online (Sandbox Code Playgroud)

然后取估计的下端并对此进行排序.因此,2/2(由Agresti-Coull提供)95%可能在"有用性"范围内下降23.7%至100%,因此它的排序低于999/1000,其范围为99.2%至100%(自.237 < 0.992).

编辑:由于有些人似乎发现这有用(哈哈),请注意,可以根据您想要的自信/风险规避来调整算法.您需要的信心越少,您就越愿意放弃未经测试但得分高的评论的"经过验证的"(高投票)评论.90%置信区间给出kappa = 1.95996398,15%置信区间给出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%
Run Code Online (Sandbox Code Playgroud)

总体而言并没有那么不同,但它确实更喜欢2/2和3/4的安全性.