openskill package#

Subpackages#

Submodules#

openskill.constants module#

class openskill.constants.Constants(**options)[source]#

Bases: object

openskill.constants.beta(**options) float[source]#
openskill.constants.beta_squared(**options) float[source]#
openskill.constants.epsilon(**options) float[source]#
openskill.constants.mu(**options) float[source]#
openskill.constants.sigma(**options) float[source]#
openskill.constants.z(**options) float[source]#

openskill.ordinal module#

openskill.ordinal.ordinal(mu: float, sigma: float, **options) float[source]#

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
  • 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.

  • options – Pass in a set of custom values for constants defined in the Weng-Lin paper.

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.

openskill.statistics module#

openskill.statistics.phi_major(x)[source]#
openskill.statistics.phi_minor(x)[source]#
openskill.statistics.v(x, t)[source]#
openskill.statistics.vt(x, t)[source]#
openskill.statistics.w(x, t)[source]#
openskill.statistics.wt(x, t)[source]#

openskill.util module#

openskill.util.gamma(**options)[source]#
openskill.util.ladder_pairs(ranks: List[int])[source]#
openskill.util.rankings(teams, rank: Optional[List[int]] = None)[source]#
openskill.util.score(q, i) float[source]#
openskill.util.transpose(xs)[source]#
openskill.util.unwind(ranks, teams)[source]#
openskill.util.util_a(team_ratings)[source]#
openskill.util.util_c(team_ratings, **options)[source]#
openskill.util.util_sum_q(team_ratings, c)[source]#

Module contents#