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

Parameters
  • agent – A Rating object or a list or tuple of float objects.

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

Returns

A float object that represents a 1 dimensional value for a rating.

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.

Parameters

teams – A list of two or more teams, where teams are lists of Rating objects.

Returns

A float that represents the probability of the teams drawings.

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 to 25/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.

openskill.statistics module#

openskill.statistics.phi_major(x)[source]#
openskill.statistics.phi_major_inverse(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) Tuple[List, List[int]][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#