【发布时间】:2011-07-11 16:18:53
【问题描述】:
$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的意义是什么?最高评分是多少?
【问题讨论】:
-
你的问题是关于基本算术的吗?
-
不确定。评分3会是什么?喜欢评分:3 / 10
-
问题是:“3”有什么意义。这是什么意思,实际上。如何使用、应用、比较等。
-
不,你不正确。无法知道您提供的信息的最高价值是多少。可能是 4,一切都得到很好的评价,可能是 100,一切都得到差的评价。但就我们这里所拥有的而言,我们无法判断。
-
@wenbert 是的,这通常是当前产品的平均 x / 5。