riix.models
Implementations of online rating systems for paired comparison data.
One rating system per module, re-exported here lazily so that
from riix.models import Elo works without importing every model module
(or optional dependencies like jax, which only AutogradRatingSystem needs).
Included rating systems:
Elo: the classic Elo rating system.EloDavidson: Elo with Davidson's method of handling draws.EloMentum: Elo with momentum-based updates (heavy ball, Nesterov, or Adam).GenElo: Martin Ingram's Bayesian generalization of Elo.ConstantVarianceGlicko: Glicko with equal, unchanging variance for all competitors.Glicko: Mark Glickman's Glicko rating system.Glicko2: Mark Glickman's Glicko 2 rating system with volatility.TrueSkill: Microsoft's Bayesian TrueSkill rating system.WengLin: the Weng-Lin Bayesian online rating system (Bradley-Terry or Thurstone-Mosteller model).WengLinThurstoneMosteller: DEPRECATED, use WengLin with model='tm'.VSKF: vector covariance simplified Kalman filter.vElo: variance incorporated Elo.Melo: multidimensional Elo for partially cyclic (rock-paper-scissors-like) games.OnlineDiscDecomp: online disc decomposition (Bertrand et al. 2023).OnlineRaoKupper: online gradient ascent on the Rao-Kupper draw model.onlineMarkov: online Markov method.TemporalMassey: temporalized Massey method.Yuksel2024: Cem Yuksel's 2024 matchmaking rating system.AutogradRatingSystem: gradient updates on arbitrary differentiable likelihoods (requires the jax extra).BaselineRatingSystem: win rate / appearance / random baselines.
1""" 2Implementations of online rating systems for paired comparison data. 3One rating system per module, re-exported here lazily so that 4`from riix.models import Elo` works without importing every model module 5(or optional dependencies like jax, which only AutogradRatingSystem needs). 6 7Included rating systems: 8 9- `Elo`: the classic Elo rating system. 10- `EloDavidson`: Elo with Davidson's method of handling draws. 11- `EloMentum`: Elo with momentum-based updates (heavy ball, Nesterov, or Adam). 12- `GenElo`: Martin Ingram's Bayesian generalization of Elo. 13- `ConstantVarianceGlicko`: Glicko with equal, unchanging variance for all competitors. 14- `Glicko`: Mark Glickman's Glicko rating system. 15- `Glicko2`: Mark Glickman's Glicko 2 rating system with volatility. 16- `TrueSkill`: Microsoft's Bayesian TrueSkill rating system. 17- `WengLin`: the Weng-Lin Bayesian online rating system (Bradley-Terry or Thurstone-Mosteller model). 18- `WengLinThurstoneMosteller`: DEPRECATED, use WengLin with model='tm'. 19- `VSKF`: vector covariance simplified Kalman filter. 20- `vElo`: variance incorporated Elo. 21- `Melo`: multidimensional Elo for partially cyclic (rock-paper-scissors-like) games. 22- `OnlineDiscDecomp`: online disc decomposition (Bertrand et al. 2023). 23- `OnlineRaoKupper`: online gradient ascent on the Rao-Kupper draw model. 24- `onlineMarkov`: online Markov method. 25- `TemporalMassey`: temporalized Massey method. 26- `Yuksel2024`: Cem Yuksel's 2024 matchmaking rating system. 27- `AutogradRatingSystem`: gradient updates on arbitrary differentiable likelihoods (requires the jax extra). 28- `BaselineRatingSystem`: win rate / appearance / random baselines. 29""" 30 31import importlib 32 33_MODEL_LOCATIONS = { 34 'AutogradRatingSystem': 'autograd_rating_system', 35 'BaselineRatingSystem': 'baselines', 36 'ConstantVarianceGlicko': 'constant_variance_glicko', 37 'Elo': 'elo', 38 'EloDavidson': 'elo_davidson', 39 'EloMentum': 'elomentum', 40 'GenElo': 'gen_elo', 41 'Glicko': 'glicko', 42 'Glicko2': 'glicko2', 43 'Melo': 'melo', 44 'OnlineDiscDecomp': 'online_disc_decomp', 45 'OnlineRaoKupper': 'online_rao_kupper', 46 'TemporalMassey': 'temporal_massey', 47 'TrueSkill': 'trueskill', 48 'VSKF': 'skf', 49 'WengLin': 'weng_lin', 50 'WengLinThurstoneMosteller': 'weng_lin_thurstone_mosteller', 51 'Yuksel2024': 'yuksel_2024', 52 'onlineMarkov': 'iterative_markov', 53 'vElo': 'velo', 54} 55 56__all__ = sorted(_MODEL_LOCATIONS) 57 58 59def __getattr__(name): 60 if name in _MODEL_LOCATIONS: 61 module = importlib.import_module(f'.{_MODEL_LOCATIONS[name]}', __name__) 62 return getattr(module, name) 63 raise AttributeError(f'module {__name__!r} has no attribute {name!r}') 64 65 66def __dir__(): 67 return sorted(list(globals()) + __all__)
AutogradRatingSystem
BaselineRatingSystem
ConstantVarianceGlicko
Elo
EloDavidson
EloMentum
GenElo
Glicko
Glicko2
Melo
OnlineDiscDecomp
OnlineRaoKupper
TemporalMassey
TrueSkill
VSKF
WengLin
WengLinThurstoneMosteller
Yuksel2024
onlineMarkov
vElo