MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / update_ratings_for_round

Function update_ratings_for_round

codeclash/analysis/metrics/tskill.py:50–64  ·  view source on GitHub ↗
(scores_dict)

Source from the content-addressed store, hash-verified

48
49
50def update_ratings_for_round(scores_dict):
51 ordered, ranks = scores_to_ranks(scores_dict)
52
53 # Convert to the Rating objects, preserving team order
54 team_ratings = [[ratings[name]] for name, _ in ordered]
55
56 # ranks vector matches the order of `teams`
57 ranks_vec = [ranks[name] for name, _ in ordered]
58
59 # Update using TrueSkill (one multi-player game)
60 new_team_ratings = ts.rate(team_ratings, ranks=ranks_vec)
61
62 # Write back
63 for (name, _), new_rating in zip(ordered, new_team_ratings):
64 ratings[name] = new_rating[0]
65
66
67def conservative_score(r):

Callers 1

tskill.pyFile · 0.85

Calls 1

scores_to_ranksFunction · 0.85

Tested by

no test coverage detected