djcunningham0/multielo

allow ties

djcunningham0 opened this issue · 1 comments

The current implementation doesn't allow ties. Some games allow ties so this functionality should be added. Ideally in a way that's backwards compatible.

Not sure of the best way to do this without large rewrites to the code. Current syntax to get new ratings is:

elo.get_new_ratings([rating_1, rating_2, rating_3, rating_4])

Suppose players 2 and 3 tie. Maybe allow syntax like this?

elo.get_new_ratings([rating_1, (rating_2, rating_3), rating_4])

Then we'd have to figure out how ties should effect rating updates. It's pretty easy for 1v1 matchups -- each player gets an actual score of 0.5 -- but maybe a bit more complicated for multiplayer matchups. I'll have to think about it a bit.

Going with a slightly different syntax. If players 2 and 3 tie, then calculate new ratings like this:

elo.get_new_ratings([rating_1, rating_2, rating_3, rating_4], result_order=[1, 2, 2, 3])

(Note: it doesn't matter if you use [1, 2, 2, 3] or [1, 2, 2, 4])

Can also handle ties in the Tracker object. The dataframe for Tracker.process_data should look like this if there is a tie:

|   date | 1st                        | 2nd               | 3rd   | 4th |
|--------|----------------------------|-------------------|-------|-----|
|      1 | Lisa                       | ('Bart', 'Marge') | Homer |     |

(Similarly, it doesn't matter if Homer is in the 3rd column or the 4th)

PR coming soon.