Voting algorithm: how to calculate rank?

故事扮演 提交于 2019-12-03 16:13:37

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.

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.

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.

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

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?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!