Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat. req.] Inverse update (undo)? #2

Open
cyqsimon opened this issue Nov 14, 2022 · 4 comments
Open

[feat. req.] Inverse update (undo)? #2

cyqsimon opened this issue Nov 14, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@cyqsimon
Copy link
Contributor

In some cases the user may wish to retroactively invalidate a game and reverse the effects it had on the ratings of the players involved. For example when:

  • a game's result was recorded incorrectly;
  • a player was retroactively disqualified;
  • the tournament in which the game was played was cancelled;
  • etc.

So I think it would be a good idea to provide the inverse of an "update" function, an "undo" if you will.

As far as I know the update algorithm for Elo is invertible, but I'm not sure about other rating systems. Do you think this is something that can be implemented without substantial effort?

@atomflunder atomflunder added the enhancement New feature or request label Nov 14, 2022
@atomflunder
Copy link
Owner

atomflunder commented Nov 14, 2022

Hi, thanks for the feature request!

I am by no means a maths expert, but I think since the Elo algorithm uses the previous values to calculate the expected score for the new ratings it would be non-trivial to revert the calculations as far as I know.
As for some of the other algorithms that are not based on Elo I am fairly pessimistic, just off the top of my head the volatility calculations for Glicko-2 will probably be an issue, and the general complexity of the TrueSkill calculations will certainly not be easy.

But if you can find anything please do let me know. I would like to be proven wrong here since I do think this would be a nice addition.

I also run a leaderboard using TrueSkill calculations and the way I revert matches there is to store the ratings and deviations before the game happened in a database to revert back to those values. But this is only an option if both players have not played additional matches, or you would need to re-calculate the games afterwards.
I know this is not the most practical solution.

Again, I do really like the solution and I am open to work on this, if it does prove to be doable. If you want to contribute that would of course be greatly appreciated as well!

@marcospb19
Copy link

I also run a leaderboard using TrueSkill calculations and the way I revert matches there is to store the ratings and deviations before the game happened in a database to revert back to those values.

After invalidating one game, do you re-run calculations for all matches that happened after, or do you just subtract the diff?

@atomflunder
Copy link
Owner

atomflunder commented Feb 9, 2024

@marcospb19 Yes, you would need to re-run the calculations for every match affected by it, unfortunately. Subtracting would yield inaccurate results

Maybe we should add a sort of "bulk match calculation" function for this scenario 🤔

@marcospb19
Copy link

I think I'd rather do a for-loop instead 😃.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants