glandfried / TrueSkillThroughTime

TrueSkill Through Time: the Julia, Python and R packages.
25 stars 3 forks source link

Allow for callback function to set uncertainty decay #2

Open zass30 opened 2 years ago

zass30 commented 2 years ago

Let a user specify a manual uncertainty decay function. This could either be run at set intervals in a game's history for all players (for example as a daily job), or else called ad-hoc when querying a given player's ranking, or else called as a callback when parsing new games. As an example, a basic decay function could be that sigma is multiplied by some factor, like 1.1, for every day a player has not played.

glandfried commented 2 years ago

Hi @zass30,

The equation 11 of the documentation [1] models the forgetting rate.

equation

The parameter History(... gamma = g) is the forgetting rate, as used in code 7, 11. This rate will govern all players without prior. We can set different rate initializing the parameter priors, History(..., priors), which is a dictionary Id - Player(Gaussian(mu, sigma), beta, gamma) class.

code7 code11

Note that the class History uses the temporal distance between events to determine the amount of dynamic uncertainty to be added between games. So the equation 11 is implemented as:

forget

The amount of time between events is set out by the parameter times History(..., times).

code12 code13

At the moment this is the only forgetting function implemented in the three packages.

[1] https://github.com/glandfried/TrueSkillThroughTime/releases/download/doc/landfried-learning.pdf