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.
source
share