5星贝叶斯评级回报百分比

时间:2012-04-23 08:56:01

标签: algorithm bayesian

我建立5星评级系统。问题来自用户对照片评分并最终 br 将返回超过100%,我怎样才能确保它以百分比回报并且不超过100%

br = ( (avg_num_votes * avg_rating) + (this_num_votes * this_rating) ) / (avg_num_votes + this_num_votes)

1 个答案:

答案 0 :(得分:1)

假设avg_ratingthis_rating都不超过100%,并且所有值都是非负数,那么您的公式永远不会超过100%。

br = ( (avg_n * avg_r) + (this_n * this_r) ) / (avg_n + this_n) <=
   <= ( (avg_n * 100%) + (this_n * 100%) ) / (avg_n + this_n) =
   = 100% * (avg_n + this_n) / (avg_n + this_n) =
   = 100%

如果avg_ratingthis_rating未按百分比衡量(例如,它们是星数0-5),则应首先将它们转换为百分比。