views:

567

answers:

6

Hi,

I am trying to figure our a way to calculate rank. Right now it simply takes ratio of wins / losses of each individual entry, so e.g. one won 99 times out of a 100, it has 99% winning rank. BUT if an entry won 1 out of total 1 votes, it will have a 100% winning rank, but definitely it can't be higher that of the one that won 99 times. What would be a better way to do this?

+2  A: 

While not identical, I think the answers to this SO question could help: http://stackoverflow.com/questions/1994763/calculating-scores-from-incomplete-league-tables

DanSingerman
A: 

if i understand the question correctly, then whoever gets more votes has the higher rank.

rashid
No, see my comment to dball917 above
SODA
you could also use something like this to get a score %:score = (win / (win + lost) ) * 100
rashid
+3  A: 

Depending on how complicated you want to make it, the Elo system chess uses (or something similar) may be what you want: http://en.wikipedia.org/wiki/Elo_rating_system

Even if a person has won 1/1 matches, his rating would be far below someone who has won/lost hundreds of matches against tough opponents, for instance.

yx
Thanks, excellent resource.
SODA
+1  A: 

You could always use a point system rather than win/loss ratio. Winning would always give points and then you could play around with either removing points for losing, not awarding points at all for losing, or awarding less points for losing. It all depends on exactly how you want people to be ranked. For example you may want to give 2 points for winning and 1 point for losing if you want to favor people who participate over those who do not (which sounds kind of like what you were talking about in your example of the person playing 100 games vs 1 game). The NHL uses a similar technique for rankings (2 points for a win, 1 point for an overtime loss, 0 points for a regular loss). That might give you some more flexibility.

dball917
This way new better entries will NEVER be able to catch up with older ones if we use points. They'll always have a lag even if their win/loss ratio is higher.
SODA
Yeah, like I said it depends on what you want to do. The post seemed to indicate he wanted to favor people with more games played.
dball917
A: 

Would it make sense to add more rank to winning entry if losing entry originally had a much higher rank, e.g. much stronger competitor?

SODA
+3  A: 

Try something like this:

votes = wins + losses
score = votes * ( wins / votes )

That way, something with 50% wins, but a million votes would still be ahead of something with 100% wins but only one vote.

You can add in an extra weight based on age (in days in this example), too, something like

if age < 5:
    score = score + ((highest real score on site) * ((5 - age) / 5)

This will put brand new entries right at the top of the first page, and then they will move slowly down the list over the course of the next 5 days (I'm assuming age is a fractional number, not just an integer). After the 5 days are up, they will be put in the list based solely on the score from the previous bit of pseudo-code.

pib