forked from Hanabi/hanabi-league
Fix: evaluate k-factor per rating type correctly
For a low number of games (K=20 for default config), the K-factor is higher than usual. This was evaluated globally and not per rating type as it should be. This commit introduces counting the number of played games per rating type now, leading to K-factors which are independ across rating types
This commit is contained in:
parent
b16b90e1c1
commit
aedf4a1008
1 changed files with 3 additions and 1 deletions
|
@ -167,6 +167,7 @@ def process_rating_of_next_game() -> bool:
|
|||
"FROM game_participants "
|
||||
"INNER JOIN games "
|
||||
" ON games.id = game_participants.game_id "
|
||||
"INNER JOIN variants ON games.variant_id = variants.id "
|
||||
"WHERE user_id IN"
|
||||
" ("
|
||||
" SELECT game_participants.user_id FROM games "
|
||||
|
@ -175,8 +176,9 @@ def process_rating_of_next_game() -> bool:
|
|||
" WHERE games.id = %s"
|
||||
" )"
|
||||
"AND league_id <= %s "
|
||||
"AND rating_type = %s "
|
||||
"GROUP BY user_id",
|
||||
(game_id, league_id)
|
||||
(game_id, league_id, rating_type)
|
||||
)
|
||||
games_played = {}
|
||||
for (user_id, num_games) in cur.fetchall():
|
||||
|
|
Loading…
Reference in a new issue