views:

130

answers:

4

Hello guys,

For a school project, we'll have to implement a ranking system. However, we figured that a dumb rank average would suck: something that one user ranked 5 stars would have a better average that something 188 users ranked 4 stars, and that's just stupid.

So I'm wondering if any of you have an example algorithm of "smart" ranking. It only needs to take in account the rankings given and the number of rankings.

Thanks!

+4  A: 

Here's a decent article describing the theory behind a Bayesian Ranking system:

Bayesian Rating - how to implement a weighted ranking system

Justin Niessner
Thanks, I'll be reading that.
zneak
This answer is good. It could be made nigh perfect by copying some of the linked information over to this answer, so that it would remain if the original link dies.
Beska
@Beska I'm a bit short on time at the moment, I'll definitely move some across shortly.
Justin Niessner
A: 

Have a look at Code Project Rating and Reputation FAQ, it may help.

Sameh Serag
Either I got it right and they're doing a simple weighted average (in which case this unfortunately won't help me), either I didn't understand and you'll have to explain me.
zneak
A: 

A simple solution might be a weighted average:

sum(votes) / number_of_votes

That way, 3 people voting 1 star, and one person voting 5 would give a weighted average of (1+1+1+5)/4 = 2 stars.

Simple, effective, and probably sufficient for your purposes.

KarstenF
How is that different than a regular average? Also, It still has the problem the OP wanted to fix, in that a person with a single vote of "5" will rank higher than a another person with 100 votes of 4.
EJB
This is exactly what (s)he didn't want. 1 person 5 stars would give an average of 5 stars.
Beska
@E.J. Brennan: "Jinx!"
Beska
Wow my brain must be on holiday! Don't know what I was thinking... downvotes are deserved!
KarstenF
Well, yeah, that doesn't really solve my problem. :/
zneak
+5  A: 

Take a look here: How not to sort by average rating.

Svante
+1. See also Randall Munroe's article on how it's used on Reddit: http://blog.reddit.com/2009/10/reddits-new-comment-sorting-system.html . This system also has the advantage that you don't need to know the average rating, or recalculate when it changes, which is required by the bayesian system.
Nick Johnson
This is pretty cool, though it seems to work only for a good/bad rating, and not for a "start-based" system. Might come in handy anyways, so I'll +1 you.
zneak
@my other comment: where was my head when I wrote this? It's a "scale-based" system, not really a "star-based" one, and even less "start-based".
zneak
Really neat, but do you have any idea how to adapt it to a star-based system ? Even though I am not sure that a star-based system is actually better that a simple +/-, I often have a hard-time picking between 3.5 and 4....
Matthieu M.