Weighted win percentage by number of games played
Im looking to create a ranking system for users on a gaming site.
The system should be based of a weighted win percentage with the weighted element being the number of games played.
For instance:
55 wins and 2 losses = 96% win percentage
1 win and 0 losses = 100% win percentage
The first record should rank higher because they have a higher number of wins. I'm sure the math is super simp开发者_StackOverflow社区le, I just can't wrap my head around it. Can anyone help?
ELO is more thorough because it considers opponent strength when scoring a win or loss, but if opponents are randomly matched a simple and very effect approach is:
(Wins + constant * Average Win % of all players) / (Wins + Losses + constant)
so with 0 games the formula is the average for all players, as you increase the number of games played the formula converges on the actual record. The constant determines how quickly it does this and you can probably get away with choosing something between 5 and 20.
Yes, it is "super simple":
Percentage = Wins * 100.0 / (Wins + Losses)
To round to an integer you usually use round
or Math.round
(but you didn't specify a programming language).
The value could be weighted on the number of wins, using the given ratio:
Rank = Wins * Wins / (Wins + Losses)
But there are other systems that understand the problem better, like Elo (see my comment).
Another possibility would be my answer to How should I order these “helpful” scores?. Basically, use the number of wins to determine the range of likely possibilities for the probability that the player win a game, then take the lower end. This makes 55-2 beat 1-0 for any reasonable choice of the confidence level. (Lacking a reason to do otherwise, I'd suggest setting that to 50% -- see the post for the details, which are actually very simple.)
As a small technical aside: I've seen some suggestions to use the Wald interval rather than Agresti-Coull. Practically, they give the same results for large inputs. But there are good reasons to prefer Agresti-Coull if the number of games might be small. (By the way, I came up with this idea on my own—though surely I was not the first—and only later found that it was somewhat standard.)
How about score = (points per win) * (number of wins) + (points per loss) * (number of losses), where points per win is some positive number and points per loss is some negative number, chosen to work well for you application.
精彩评论