Open Venners09 opened 1 year ago
Hi @Venners09,
Thanks for your question. It could be; I'm afraid I wasn't looking at games with draws originally, but this is a good extension.
AFAIK the Elo and Glicko systems both treat draws as a 0.5
point to each player. So the necessary change for this is relatively straightforward:
the base RatingModel.update()
API needs to be updated;
def update(self, winner, loser, timestamp, is_draw=False):
....
label
value passed to evolve_rating()
should just be set to 0.5
in this case here and hereThe RatingEstimator.fit()
loop here needs to have some additional logic to check for a 0.5
-valued floating point label, rather than an assumed binary/integer label, and use this to call rating_model.update(winner, loser, timestamp, is_draw=???)
The additional draw case should have tests added to test_elo.py
here
The docstrings for the RatingModel.update
and RatingEstimator.fit()
methods need to be updated to explain the API change, and probably an example should be added to the main documentation as well
The Elo and Glicko rating models don't need to be changed
the package version needs to be up'd and uploaded to pypi as per the steps here
So all in all nothing too complicated, but a bit of work. I could do this, but just not sure when.
Would you please lmk if you'd be interested in contributing a PR for this?
Can this be adapted to include draws between opponents? In terms of a football application there can be a home win, away win or a draw