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

Function update_elo

codeclash/analysis/bootstrap/bootstrap.py:24–31  ·  view source on GitHub ↗

Update Elo rating based on game outcome. actual: 1.0 for win, 0.5 for draw, 0.0 for loss k: K-factor, typically 32 for regular players, 16 for masters

(*, current_rating: float, expected_score: float, actual_score: float, k: float = 32)

Source from the content-addressed store, hash-verified

22
23
24def update_elo(*, current_rating: float, expected_score: float, actual_score: float, k: float = 32) -> float:
25 """
26 Update Elo rating based on game outcome.
27
28 actual: 1.0 for win, 0.5 for draw, 0.0 for loss
29 k: K-factor, typically 32 for regular players, 16 for masters
30 """
31 return current_rating + k * (actual_score - expected_score)
32
33
34# Modeling limitation, draw probability probably usually depends on score difference

Callers 2

_update_elo_per_roundMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected