September 30th, 2012, 04:22 PM
Ranking Average Ratings
I realise this isn't strictly a PHP problem, but I am coding in PHP and I can't see a Statistics forum!
I'm making a website that allows users to rate certain items out of 10. The items are displayed on various sections of the site, including some lists to say which are the highest rated items and which are the lowest rated items.
I store the ratings in a MySQL database and I can easily retrieve the mean rating using the AVG function. The problem I have is that if an item has only been rated by one person and they gave it 10/10, this item will pretty much automatically go to the top of the ratings (the AVG rating would be 10/10). Another item that had an AVG of 9.9 and had been rated by 1,000 users would drop down the rankings due to one user giving the other item 10.
I'm trying to find a good way to get around this issue, as I don't want the ranking tables to be constantly changing as new items are added.
I could wait for a certain amount of ratings before I include the item in the rankings, but then I have the problem of how many ratings is enough. I guess this is probably the way to do it, but I was wondering if anyone had any other ideas that may be of help.
I did think of weighting the ratings, by ranking the items by the number of votes. So, if there were 100 items, the item with the most votes would get a ranking of 100 and the item with the least votes would get a ranking of 1. I could then multiply the item's rank by the AVG rating. I could calculate the resulting number as a percentage to give the item a score out of 10. However, this seems like quite a long way around a relatively small problem!
I hope that makes sense and I would love any input from anyone that has come across this issue before.
September 30th, 2012, 04:53 PM
You could sort them by the amount of rates it got. That way the most populair ones are tops. Anyway its always good to give besides the star indication a count of voters to give it more meaning.
September 30th, 2012, 05:48 PM
Thanks for the reply.
Yeah. I'll display the amount of voters anyway, but if I only use the amount of voters then it gives no meaning as to if the voters actually like the item or not.
That's why I think the ranking by number of votes mixed with the average rating is more worthwhile. It's a rank based on how liked the item is and how popular it is.
September 30th, 2012, 06:03 PM
That pretty much summed up what I said
Originally Posted by makzan
September 30th, 2012, 06:12 PM
Ah, sorry! I thought you meant use only the amount of votes, not a mixture of votes and ratings