openskill package#
Subpackages#
Submodules#
openskill.constants module#
openskill.ordinal 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]]) openskill.rate.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.predict_win(teams: List[List[openskill.rate.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!) 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[openskill.rate.Rating]], **options) List[List[Union[int, float]]] [source]#
Rate multiple teams consisting of one of more agents. Order of teams determines rank.
- Parameters
- Returns
Returns a list of lists containing mu and sigma values that can be passed into
create_rating()
- openskill.rate.team_rating(game: List[List[openskill.rate.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.