glandfried / TrueSkillThroughTime

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

Let forget be a property of Player #4

Open zass30 opened 2 years ago

zass30 commented 2 years ago

As discussed in https://github.com/glandfried/TrueSkillThroughTime/issues/2 , the forget function is currently a hard coded function in the Gaussian class.

Allow each Player to define their own forget function for their own Gaussians. This allows players to forget at different rates instead of having one universal rate. It also allows for more complex functions than the one currently implemented that use parameters other than time.

glandfried commented 2 years ago

Each player has their own forgetting rate, known as gamma.

Player(Gaussian(mu, sigma), beta, gamma)

zass30 commented 2 years ago

Yes, but we may want a function that operates on additional parameters. For example, we may want a function

return Gaussian(self.mu, math.sqrt(self.sigma**2 + t*gamma**2 + 1/(diversity**2)))

Where diversity is a parameter that takes into account how many different opponents the player has played. A low diversity score would have more uncertainty. We may want to update this function depending on how the player moves through games. The function may be different at low ranks than at high ranks, for example.

If the forgetting function is a property of the player, then small simple functions can be written at various points for each player, instead of having a large complex function in Gaussian that covers all cases.

glandfried commented 2 years ago

Because we spoke personally, I know that the problem to be solved is: how to prevent players who reach a high skill estimate from "camp" their rating.

My advice was: instead of showing the mean estimate and the uncertainty, you can show the probability of winning against the other users adding uncertainty as a way to lose prior information and bring the reported probability of winning towards 0.5. Internally, the optimal forgetting rate must be used (optimizing the gamma).

The additional uncertainty must be added after the estimation process, to the estimates reported by the method learning_curves(). So there is no need to use sub-optimal forgetting functions. There is no reason to believe that diversity modifies the actual skill of players more rapidly. Use the time as the forgetting function, and add the rest on the outside.

zass30 commented 2 years ago

My advice was: instead of showing the mean estimate and the uncertainty, you can show the probability of winning against the other users adding uncertainty as a way to lose prior information and bring the reported probability of winning towards 0.5. Internally, the optimal forgetting rate must be used (optimizing the gamma).

I see now, you are recommending we keep the existing implementation internally, but create an external function for user display. In this case, how would we create a ranking board? We still desire to show some kind of external ranking of top N players. Would we apply the external uncertainty function to each user to get external rank, and then sort by this external rank?

There is no reason to believe that diversity modifies the actual skill of players more rapidly. Use the time as the forgetting function, and add the rest on the outside.

Let me propose a thought experiment. Let's take the tennis data set used in the TTT example paper. We take this set and introduce a new player, and this new player plays and wins one million games against the lowest ranked player in the set, at regular time intervals evenly spaced throughout the history. This new player will have a very low uncertainty because they have played many many games in a timely manner. All we really know is that this player isn't the worst in the set, but the model will give them a low uncertainty. Isn't this a weakness in the model? Compare to another new player that plays only one hundred games, but plays them against a wide range of opponents. Shouldn't we have a much better idea of this player's uncertainty compared to the first one?

glandfried commented 1 year ago

If a player always wins against the lowest ranked player, the new games does not reduce the uncertainty because there is no surprise. The "diversity" criterion is encoded by the strict application of probability rules. If this player then wins against someone else, we will have some surprise and therefore we will update their estimate.