rstt.ranking.observer package

Submodules

rstt.ranking.bserver.gameObserver module

Game based Observers

class rstt.ranking.observer.gameObserver.BatchGame[source]

Bases: ObsTemplate

All Matches at once updating procedure

Alternative to the rstt.ranking.observer.GamebyGame observer. Some rating system, like Elo and Glicko support updates where all matches are considered at once for the rating update.

In this workflows, ratings are stored after all matches have been processed. Every computation is performed using the prior ratings (i.e the one stored in the datamodel before the method call)

Observations

gameSMatch, optional

a game justifying a ranking update, by default None

gameslist[SMatch], optional

a list of games, by default None

eventEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

events: list[Event], optional

a list of Event, by default None

Datamodel

Rating: any

Game based observers make no assumption on ratings type.

Inferer.rate

teams : list[list[SPlayer]] scores : list[float] ratings_groups : list[list[any]]

class rstt.ranking.observer.gameObserver.GameByGame[source]

Bases: ObsTemplate

Game by Game updating Procedure

Implementing an iterative approach where each observations triggers the entire updating workflows. In particular, new ratings are stored inbetween of each iterations, and the prior ones are lost.

Observations

gameSMatch, optional

a game justifying a ranking update, by default None

gameslist[SMatch], optional

a list of games, by default None

eventEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

events: list[Event], optional

a list of Event, by default None

Datamodel

Rating: any

Game based observers make no assumption on ratings type.

Inferer.rate

teams : list[list[SPlayer]] scores : list[float] ranks : list[float] ratings_groups : list[list[any]]

rstt.ranking.observer.playerObserver module

Player based Observers

class rstt.ranking.observer.playerObserver.PlayerChecker[source]

Bases: ObsTemplate

Update Procedure based on Player’s data

Iterate over a list of SPlayer, each triggering a inferer.rate() call and the new ratings are instantly pushed in the datamodel. The assumption is that the player instance itself contains all the necessary informations to compute a rating.

Caution

Prior ratings, stored in the datamodel, are ignored and not passed to the inferer. The output of the inferer.rate defines the post ratings, which can introduce inconsistency in rating type for the datamodel.

Observations

playerSMatch, optional

a game justifying a ranking update, by default None

playerslist[SMatch], optional

a list of games, by default None

teamEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

teamslist[Event], optional

a list of Event, by default None

eventEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

events: list[Event], optional

a list of Event, by default None

Datamodel

Rating: any

Game based observers make no assumption on ratings type.

Inferer.rate

player: SPlayer

Module contents

Module for Observer

Observer is a protocol providing a handle_observations() method for ranking. This method is responsible:

  • to proprocess observations - parameters passed to rstt.ranking.ranking.Raning.update() justifying ratings changes.

  • properly call the ranking.backend rstt.stypes.Infere.rate()

  • store new ratings in the ranking.datamodel rstt.stypes.RatingSystem

Warning

Currently RSTT SMatch support is limited to the Duel class. This is also true for ‘Game based’ Observer. Typecheckers may look for SMatch and not for Duel. This can cause unexpected errors in your simulations.

class rstt.ranking.observer.BatchGame[source]

Bases: ObsTemplate

All Matches at once updating procedure

Alternative to the rstt.ranking.observer.GamebyGame observer. Some rating system, like Elo and Glicko support updates where all matches are considered at once for the rating update.

In this workflows, ratings are stored after all matches have been processed. Every computation is performed using the prior ratings (i.e the one stored in the datamodel before the method call)

Observations

gameSMatch, optional

a game justifying a ranking update, by default None

gameslist[SMatch], optional

a list of games, by default None

eventEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

events: list[Event], optional

a list of Event, by default None

Datamodel

Rating: any

Game based observers make no assumption on ratings type.

Inferer.rate

teams : list[list[SPlayer]] scores : list[float] ratings_groups : list[list[any]]

class rstt.ranking.observer.GameByGame[source]

Bases: ObsTemplate

Game by Game updating Procedure

Implementing an iterative approach where each observations triggers the entire updating workflows. In particular, new ratings are stored inbetween of each iterations, and the prior ones are lost.

Observations

gameSMatch, optional

a game justifying a ranking update, by default None

gameslist[SMatch], optional

a list of games, by default None

eventEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

events: list[Event], optional

a list of Event, by default None

Datamodel

Rating: any

Game based observers make no assumption on ratings type.

Inferer.rate

teams : list[list[SPlayer]] scores : list[float] ranks : list[float] ratings_groups : list[list[any]]

class rstt.ranking.observer.NoHandling[source]

Bases: ObsTemplate

Exclude-members:

class rstt.ranking.observer.ObsTemplate[source]

Bases: Observer

convertor(*args, **kwargs) Any[source]
extractor(observations: Any) list[Any][source]
handle_observations(infer: Inference, datamodel: RatingSystem, *args, **kwargs) None[source]

method that triggers a rating update routine

The method uses a RatingSystem to get prior rating of Player and store updated ratings. It uses an Inference instance to compute the updated ratings, usually from the prior ratings and some additional parameters

Parameters

inferInference

An inference object responsible to update ratings

datamodelRatingSystem

A ratingSystem object storing rating compatible with the passed infer.

output_formater(data: Any, output: Any)[source]
push(data: Any, posteriori: RatingSystem)[source]
query(prior: RatingSystem, data: Any)[source]
class rstt.ranking.observer.PlayerChecker[source]

Bases: ObsTemplate

Update Procedure based on Player’s data

Iterate over a list of SPlayer, each triggering a inferer.rate() call and the new ratings are instantly pushed in the datamodel. The assumption is that the player instance itself contains all the necessary informations to compute a rating.

Caution

Prior ratings, stored in the datamodel, are ignored and not passed to the inferer. The output of the inferer.rate defines the post ratings, which can introduce inconsistency in rating type for the datamodel.

Observations

playerSMatch, optional

a game justifying a ranking update, by default None

playerslist[SMatch], optional

a list of games, by default None

teamEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

teamslist[Event], optional

a list of Event, by default None

eventEvent, optional

the observer uses Event.games() to extract the observations, by defualt None

events: list[Event], optional

a list of Event, by default None

Datamodel

Rating: any

Game based observers make no assumption on ratings type.

Inferer.rate

player: SPlayer