-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from OpenDebates/tau-option
Implement additive dynamics factor 'tau'.
- Loading branch information
Showing
3 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
``tau`` (defaults to 0): Additive dynamics factor, which keeps a player's rating from getting stuck at a level. Normally, a player's sigma will only decrease as we gain more information about their performance. This option will put some pressure on this back up. This default will change to be sigma/100 with v3, to be more congruent with TrueSkill, but higher may make your rating system more exciting. | ||
|
||
``prevent_sigma_increase`` (defaults to false): for a tau > 0, it is possible that a player could play someone with a low enough rating that even if they win, their ordinal rating will still go down slightly. If your players have no agency in matchmaking, it is not desirable to have a situation where a player goes down on the leaderboard even though they win. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from openskill import Rating, rate | ||
|
||
|
||
def test_rate(): | ||
|
||
# Accepts a tau term | ||
a = Rating(sigma=3) | ||
b = Rating(sigma=3) | ||
[[winner], [loser]] = rate([[a], [b]], tau=0.3) | ||
assert [[winner], [loser]] == [ | ||
[Rating(mu=25.624880438870754, sigma=2.9879993738476953)], | ||
[Rating(mu=24.375119561129246, sigma=2.9879993738476953)], | ||
] | ||
|
||
# Prevents sigma from rising | ||
a = Rating(mu=40, sigma=3) | ||
b = Rating(mu=-20, sigma=3) | ||
[[winner], [loser]] = rate([[a], [b]], tau=0.3, prevent_sigma_increase=True) | ||
assert [[winner], [loser]] == [ | ||
[Rating(mu=40.00032667136128, sigma=3)], | ||
[Rating(mu=-20.000326671361275, sigma=3)], | ||
] | ||
|
||
# Ensures sigma decreases | ||
a = Rating() | ||
b = Rating() | ||
[[winner], [loser]] = rate([[a], [b]], tau=0.3, prevent_sigma_increase=True) | ||
assert [[winner], [loser]] == [ | ||
[Rating(mu=27.6372798316677, sigma=8.070625245679999)], | ||
[Rating(mu=22.3627201683323, sigma=8.070625245679999)], | ||
] |