1

In my database, each item has a total_votes and total_ranking. When a user vote, I add +1 to the total votes and add its rating (1 to 5, 5 is the highest) to the total_ranking (total_ranking = total_ranking + user_vote).

This is all the data that I have. I want a better algorithm to calculate the "best" item. Right now I just do an average, but if one item has rating of 5, it can beat another item with 5000 rating and average of 4.9.

Is there any good alternative consider that I only have those two columns.

Update: I thought about using this formula

total_votes^(average_rating / 10) + (average_rating)
  • 1
    There are several good alternatives but no consensus about what's best. Here's a paper that says you may want to weight it as a percentage http://faculty.chicagobooth.edu/chris.nosko/research/EPP_020815_cn.pdf you may also want to give more recent voters higher weight. – user103828 Feb 16 '15 at 20:23
  • Thanks for the link, but unfortunately I need to find a solution for what I have now. I am considering the minimum votes option. – Liron Harel Feb 16 '15 at 20:26
  • 2
    The minimum votes option benefits the buyer, but cripples the seller unless there is some way of promoting undervoted items as well. If something is on the bottom of the list due to having too few votes, and noone ever looks at the bottom of the list, it might never receive more votes and will remain ignored despite potentially being a great product. – JMoravitz Feb 16 '15 at 20:29
  • I am also trying a formula that add extra score based on the average and total number of votes, like votes_total * (average / 100) - is it a good option? – Liron Harel Feb 16 '15 at 20:30

1 Answers1

0

Look around various retail websites and see how they treat the situation. Often times, they also will list items with very few but very good ratings above those with many ratings but slightly lower average rating. A way to combat this in practice, is to provide ways to filter results based on minimum number of votes, or perhaps use a sample standard deviation argument and compare based on one sample standard deviation lower than the true average.

Take for example Amazon.

enter image description here

enter image description here

enter image description here

As you can see, Amazon also follows the pattern of when sorting by rating first, the book with only 133 ratings but average rating of 4.8 appears before the book with over 2500 ratings but average rating of 4.6.

It should be mentioned that 'better rating first' sort is not the default sort. They use a 'relevancy' sort as default, the specifics of which I am unsure of.

JMoravitz
  • 79,518