Please reccomend any functionality you think should be added!
A python library for the Elo Rating System. Right now it only supports 1 vs 1 games.
If Player A has a rating of RA and Player B a rating of RB, the exact formula for Player A's score is:
And Player B's score is:
Supposing Player A was expected to score EA points but actually scored SA points. The formula for updating his/her rating is:
Right now the K factor is found by the number of player multiplied by 42 as a constant. Working on custom K factors.
from elopy import *
i = Implementation()
i.addPlayer("Hank") #default ranking is 1000
i.addPlayer("Bill",rating=900)
print i.getPlayerRating("Hank"), i.getPlayerRating("Bill")
i.removePlayer("Hank")
print i.getRatingList()
1000 900
900
i.recordMatch("Hank","Bill",winner="Hank")
print i.getRatingList()
i.recordMatch("Hank","Bill",winner="Bill")
print i.getRatingList()
i.recordMatch("Hank","Bill",draw=True)
print i.getRatingList()
[('Hank', 1030.2345400165577), ('Bill', 869.7654599834424)]
[('Hank', 970.1071401496504), ('Bill', 929.8928598503497)]
[('Hank', 965.2674016281943), ('Bill', 934.7325983718058)]