贝叶斯评级 [英] Bayesian Rating
本文介绍了贝叶斯评级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$avg_num_votes = 18; // Average number of votes in all products
$avg_rating = 3.7; // Average rating for all products
$this_num_votes = 6; // Number of votes for this product
$this_rating = 4; // Rating for this product
$bayesian_rating = ( ($avg_num_votes * $avg_rating) + ($this_num_votes * $this_rating) ) / ($avg_num_votes + $this_num_votes);
echo round($bayesian_rating); // 3
3的意义是什么?可能的最高评分是什么?
解决方案
您正在将该产品的等级与所有产品中的等级进行比较,因此您的答案是一个等级.如果$ avg_rating和$ this_rating是3.7,而满分为10,则答案是4.如果答案是满分5,则答案是满分5.$ bayesian_rating,$ avg_rating和$ this_rating都是可比较的./p>
$avg_num_votes = 18; // Average number of votes in all products
$avg_rating = 3.7; // Average rating for all products
$this_num_votes = 6; // Number of votes for this product
$this_rating = 4; // Rating for this product
$bayesian_rating = ( ($avg_num_votes * $avg_rating) + ($this_num_votes * $this_rating) ) / ($avg_num_votes + $this_num_votes);
echo round($bayesian_rating); // 3
What is the significance of 3? What is the highest possible rating?
解决方案
you're comparing the ratings for this product against the ratings in all products, so your answer is a rating. If $avg_rating and $this_rating are 3.7 and 4 out of 10, then your answer is out of 10. If it's out of 5, then your answer is out of 5. $bayesian_rating, $avg_rating, and $this_rating are all comparable.
这篇关于贝叶斯评级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文