-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor tournament wins/draws/losses, adjust displays #30
Conversation
N = self.total_engines | ||
len_names = max(5, min(24, max([len(x) for x in self.engine_names]) + 1)) | ||
len_score = max(6, max([math.floor(math.log10(max(1, self.total_scores[i])) + 1) for i in range(N)]) + 1) | ||
len_games = max(7, max([math.floor(math.log10(max(1, self.game_counts[i])) + 1) for i in range(N)]) + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number at the front with max(#
is effectively the minimum column width. If there is then a min(#
that is effectively the maximum column width, otherwise no max width. Then there is a max
of the data, usually with + 1
for one additional padding on the max data length
wins[winners[0]] += 1 | ||
else: | ||
for p in winners: | ||
draws[p] += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Distinguish between truly winning and drawing
return self.elo_end[engine] | ||
|
||
def get_delta_elo_by_engine(self, engine: int) -> int: | ||
return self.elo_end[engine] - self.elo_start[engine] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These all have properties now, so just use results.property[engine]
instead of results.function(engine)
out += f"{'Avg Score':>10} {'Wins':>6} {'Win Rate':>9}\n" | ||
ranked_engines = sorted(range(N), key=lambda x: -elos[x]) | ||
for rank, engine in enumerate(ranked_engines): | ||
len_name = max(5, min(24, max([len(x.name) for x in self.engines]) + 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to not have this function duplicated, but it uses so much data it would be really annoying to pass all necessary data into a static version or something. So for now I'm most happy with it duplicated, one here in the running tournament instance and one in the results data class.
TLDR:
K=8
for Elo calculations in tournaments, should be more stable/slow changingMore specifically on "winning": Now track "wins" for players truly winning alone, without a tie to another player. Then "draws" are for players tied with the highest score, and "losses" are for anyone without the highest score.
Old Summary
New Summary
Summary changes:
Results structure changes:
win_counts
is now the new definition of winsdraw_counts
new property for the amount of drawslose_counts
new computed property bygame_counts - win_counts - draw_counts
win_rates
unchanged computed property, but uses the new definition of winsdraw_rates
new computed property for the rate of drawinglose_rates
new computed property for the rate of losingwin_draw_rates
new computed property for the old definition of winning,(win_counts + draw_counts) / game_counts
elo_delta
new computed property for the change in elo from the tournament