Skip to content

Commit

Permalink
Merge branch 'main' into tied-rankings
Browse files Browse the repository at this point in the history
  • Loading branch information
philihp committed Feb 7, 2021
2 parents 37eccfd + 2f2c7ad commit df3bdd6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ Ties should have either equivalent rank or score.
]
```
## Implementations
* Kotlin https://github.com/brezinajn/openskill
* Elixir https://github.com/philihp/openskill.ex
## TODO
- Configurable alternate `gamma` to avoid ill-conditioning problems from large numbers of teams, as discussed in the paper.
15 changes: 4 additions & 11 deletions benchmark/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"csv-parser": "3.0.0",
"microtime": "3.0.0",
"ndjson": "2.0.0",
"openskill": "1.0.1",
"openskill": "1.1.1",
"ramda": "0.27.1",
"ts-trueskill": "3.2.0"
}
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openskill",
"version": "1.1.0",
"version": "1.1.1",
"description": "Weng-Lin Bayesian approximation method for online skill-ranking.",
"scripts": {
"build": "babel src -d dist",
Expand All @@ -27,13 +27,13 @@
},
"homepage": "https://github.com/philihp/openskill.js#readme",
"devDependencies": {
"@babel/cli": "7.12.10",
"@babel/core": "7.12.10",
"@babel/preset-env": "7.12.11",
"@babel/register": "7.12.10",
"@babel/cli": "7.12.13",
"@babel/core": "7.12.13",
"@babel/preset-env": "7.12.13",
"@babel/register": "7.12.13",
"@philihp/eslint-config": "4.2.0",
"husky": "5.0.6",
"lint-staged": "10.5.3",
"husky": "5.0.8",
"lint-staged": "10.5.4",
"prettier": "2.2.1"
},
"lint-staged": {
Expand Down
12 changes: 12 additions & 0 deletions src/__tests__/rating.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,16 @@ describe('rating', () => {
const { sigma } = rating({ sigma: 6.283185 })
expect(sigma).toBe(6.283185)
})

it('can initialize a mu of zero', () => {
expect.assertions(1)
const { mu } = rating({ mu: 0 })
expect(mu).toBe(0)
})

it('can initialize a sigma of zero', () => {
expect.assertions(1)
const { sigma } = rating({ sigma: 0 })
expect(sigma).toBe(0)
})
})
4 changes: 2 additions & 2 deletions src/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const DEFAULT_MU = 25.0
const DEFAULT_SIGMA = DEFAULT_MU / 3.0

const rating = (initial) => ({
mu: initial?.mu || DEFAULT_MU,
sigma: initial?.sigma || DEFAULT_SIGMA,
mu: initial?.mu ?? DEFAULT_MU,
sigma: initial?.sigma ?? DEFAULT_SIGMA,
})

export default rating

0 comments on commit df3bdd6

Please sign in to comment.