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

What is the meaning of 3? What is the highest possible rating?

+2
source share
2 answers

You compare the rating for this product and the rating in all products so that your rating is rated. If $ avg_rating and $ this_rating are 3.7 and 4 out of 10, then your answer will be 10. If it is 5, then your answer will be 5. $ bayesian_rating, $ avg_rating and $ this_rating are all comparable.

+1
source

Well, having developed your math:

((18 * 3.7) + (6 * 4)) / (18 + 6)
(66.6 + 24) / (24)
90.6 / 24
3.775

So this is 3 of 1 ...

+1
source

All Articles