What is the most convinient and simple formula to calculate rating from views and favorites count?

StackOverflow https://stackoverflow.com/questions/16168727

  •  11-04-2022
  •  | 
  •  

Question

I have some content on my site with two parameters: - the number of views - the number of people who added the item to theis favorites.

I want to propose some formula to combine those two parameter in some one parameter, i.e. "rating of the item".

Was it helpful?

Solution

There's a really good formula to calculate position in ranking, when you've got users voting for particular items.

rating = (g / (g+m)) * s + (m / (g+m)) * S
  • s is average rating for the item
  • S is average rating for all items
  • g is number of votes for the item
  • m is a minimal number of votes for the item to be included in your ranking.

It works really well for Filmweb.

You'd have to modify it a little bit. Check how it would work if you counted a view of an item as rating it with 1.0 mark, and an add to favourites as 5.0. Try m = 1 at first. Possibly you'd like to change 5.0 to something like...

rating_for_a_favourite = number_of_all_views / number_of_all_adds

... perhaps with some factor < 1.0.

Try it. :-)

Edit: Using this formula, you could easily incorporate real rating (e.g. 1-5 stars) of items to your website, besides including views and favourites into rating.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top