Voting algorithm: how to calculate rank?

mvbl fst picture mvbl fst · Jan 22, 2010 · Viewed 7.5k times · Source

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?

Answer

pib picture pib · Jan 22, 2010

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.