openskill package#
Subpackages#
Submodules#
openskill.constants module#
openskill.rate module#
- class openskill.rate.Rating(mu: Optional[float] = None, sigma: Optional[float] = None, **options)[source]#
Bases:
object
The storehouse of the skill and confidence the system has in an agent. Stores the mu and sigma values of an agent.
- Parameters
mu – The mean skill of the agent.
sigma – How confident the system is the skill of an agent.
options – Pass in a set of custom values for constants defined in the Weng-Lin paper.
- openskill.rate.create_rating(rating_list: List[Union[int, float]]) Rating [source]#
Create a
Rating
object from a list of mu and sigma values.- Parameters
rating_list – A list of two values where the first value is the mu and the second value is the sigma.
- Returns
A
Rating
object created from the list passed in.
- openskill.rate.ordinal(agent: Union[Rating, list, tuple], **options) float [source]#
Convert mu and sigma into a single value for sorting purposes.
- openskill.rate.predict_draw(teams: List[List[Rating]], **options) Union[int, float] [source]#
Predict how likely a match up against teams of one or more agents will draw. This algorithm has a time complexity of O(n!/(n - 2)!) where ‘n’ is the number of teams.
- openskill.rate.predict_win(teams: List[List[Rating]], **options) List[Union[int, float]] [source]#
Predict how likely a match up against teams of one or more agents will go. This algorithm has a time complexity of O(n!/(n - 2)!) where ‘n’ is the number of teams.
- Parameters
teams – A list of two or more teams, where teams are lists of
Rating
objects.- Returns
A list of probabilities of each team winning.
- openskill.rate.rate(teams: List[List[Rating]], **options) List[List[Rating]] [source]#
Rate multiple teams consisting of one of more agents. Order of teams determines rank.
- Parameters
teams – A list of teams, where teams are lists of
Rating
objects.rank – A list of
int
where the lower values represent the winners.score – A list of
int
where higher values represent the winners.tau – A
float
that modifies the additive dynamics factor.prevent_sigma_increase – A
bool
that prevents sigma from ever increasing.options – Pass in a set of custom values for constants defined in the Weng-Lin paper.
- Returns
Returns a list of
Rating
objects.
Note
tau
will default to25/300
in the next major version update.
- openskill.rate.team_rating(game: List[List[Rating]], **options) List[List[Union[int, float]]] [source]#
Get the whole rating of a list of teams.
- Parameters
game – A list of teams, where teams are lists of
Rating
objects.options – Pass in a set of custom values for constants defined in the Weng-Lin paper.
- Returns
Returns a list of lists containing mu, sigma, the team object and the current rank of the team.