vivekjoshy / openskill.py

Multiplayer Rating System. No Friction.

Home Page:https://openskill.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Model Agnostic API

vivekjoshy opened this issue · comments

The Rating objects currently can be mixed and used between models. This may or may not make sense depending on the models under consideration. It is definitely erring on the side of caution to disallow this. It allows us to have different values (instead of mu and sigma for different models (perhaps Glicko? Standard Elo?).

Proposed API:

Note: Added a spoiler to not cause bias from my recommendation.

New API (Click to Reveal)
Similar to TrueSkill API, we can have a new class called `OpenSkill` which is initialized with the default `PlackettLuce` model.

Example code:

from openskill.models import BradleyTerryFull


# Initialize Rating System
system = BradleyTerryFull(tau=0.3,  constrain_sigma=True)

# Team 1
a1 = system.Rating()
a2 = system.Rating(mu=32.444, sigma=5.123)

# Team 2
b1 = system.Rating(43.381, 2.421)
b2 = system.Rating(mu=25.188, sigma=6.211)

# Rate with BradleyTerryFull
[[x1, x2], [y1, y2]] = system.rate([[a1, a2], [b1, b2]])  # No need to pass tau and so on again.

All functions that can be, will be converted to methods under the. All constants in the methods can be manually overridden as normal. A variable called custom will be set to True if models are mixed or constants are changed within a system after ratings have taken place.

Rating objects will contain a public attribute (Rating.model that references the model with which they were created in mind. So, if the user tries to use it in any function that takes those objects, it will produce an error.


If there are no active objections from users or any other implementation developers by the time I get to this issue in the Project Release Board (which should be a while still), then it will be shipped in the next major release.

If someone has another API idea, you are also free to suggest it in this issue.

Mentions: @philihp

Relevant Issues: philihp/openskill.js#231