{"id":15366740,"url":"https://github.com/scttcper/ts-trueskill","last_synced_at":"2025-04-04T15:07:05.658Z","repository":{"id":37706169,"uuid":"75559811","full_name":"scttcper/ts-trueskill","owner":"scttcper","description":"TypeScript port of the python TrueSkill package","archived":false,"fork":false,"pushed_at":"2024-11-01T16:19:17.000Z","size":2206,"stargazers_count":76,"open_issues_count":4,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T21:40:23.634Z","etag":null,"topics":["rating-system","trueskill","typescript"],"latest_commit_sha":null,"homepage":"https://trueskill.netlify.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scttcper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-04T19:41:03.000Z","updated_at":"2024-11-17T13:19:35.000Z","dependencies_parsed_at":"2024-02-23T20:22:10.778Z","dependency_job_id":"0987ac78-557e-4ad9-9e61-840ada91da89","html_url":"https://github.com/scttcper/ts-trueskill","commit_stats":{"total_commits":475,"total_committers":9,"mean_commits":52.77777777777778,"dds":0.3789473684210526,"last_synced_commit":"9b0fb0ebf7af4c6c09f373b832ee27c990e2a90e"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttcper%2Fts-trueskill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttcper%2Fts-trueskill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttcper%2Fts-trueskill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttcper%2Fts-trueskill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scttcper","download_url":"https://codeload.github.com/scttcper/ts-trueskill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198449,"owners_count":20900079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rating-system","trueskill","typescript"],"created_at":"2024-10-01T13:19:38.004Z","updated_at":"2025-04-04T15:07:05.641Z","avatar_url":"https://github.com/scttcper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-trueskill [![npm](https://img.shields.io/npm/v/ts-trueskill.svg?maxAge=3600)](https://www.npmjs.com/package/ts-trueskill) [![coverage status](https://codecov.io/gh/scttcper/ts-trueskill/branch/master/graph/badge.svg)](https://codecov.io/gh/scttcper/ts-trueskill)\n\u003e TypeScript port of the [python TrueSkill package](https://github.com/sublee/trueskill) by Heungsub Lee.  \n\n\n### What's TrueSkill™\n[TrueSkill](http://research.microsoft.com/en-us/projects/trueskill) is a rating system for players of a game. It was developed, patented, and trademarked by Microsoft Research and has been used on Xbox LIVE for ranking and matchmaking service. This system quantifies players’ TRUE skill points by the Bayesian inference algorithm. It also works well with any type of match rule including N:N team game or free-for-all.\nRead about [how the trueskill model works](https://www.microsoft.com/en-us/research/project/trueskill-ranking-system/)\n\n### Install\nBuilt into es2020 w/ esm and published with typings. Available on [npm](https://www.npmjs.com/package/ts-trueskill):\n```bash\nnpm install ts-trueskill\n```\n\n### API\nhttps://trueskill.netlify.app   \n\n### Use  \n2 vs 2 example:\n```ts\nimport { rate, Rating, quality } from 'ts-trueskill';\nconst team1 = [new Rating(), new Rating()];\nconst team2 = [new Rating(), new Rating()];\n\n// q is quality of the match with the players at their current rating\nconst q = quality([team1, team2]);\n\n// Assumes the first team was the winner by default\nconst [rated1, rated2] = rate([team1, team2]); // rate also takes weights of winners or draw\n// rated1 and rated2 are now arrays with updated scores from result of match\n\nconsole.log(rated1.toString()) // team 1 went up in rating\n// \u003e\u003e Rating(mu=28.108, sigma=7.774),Rating(mu=28.108, sigma=7.774)\nconsole.log(rated2.toString()) // team 2 went down in rating\n// \u003e\u003e Rating(mu=21.892, sigma=7.774),Rating(mu=21.892, sigma=7.774)\n```\n\n1 vs 1 example:  \nusing shortcut functions for 1vs1 matches\n```ts\nimport { Rating, quality_1vs1, rate_1vs1 } from 'ts-trueskill';\nconst p1 = new Rating(40, 4); // 1P's skill\nconst p2 = new Rating(10, 4); // 2P's skill\nconst q = quality_1vs1(p1, p2); // quality will be low from large difference in scores\nconst [newP1, newP2] = rate_1vs1(p1, p2); // get new ratings after p1 wins\n```\n\n### Differences from python version\n- Does not support multiple backends\n\n### License\nThis package is Licensed under MIT, but is a port of the [BSD](http://en.wikipedia.org/wiki/BSD_licenses) licensed python TrueSkill package by Heungsub Lee. The _TrueSkill™_ brand is not very permissive. Microsoft permits only Xbox Live games or non-commercial projects to use TrueSkill™.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscttcper%2Fts-trueskill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscttcper%2Fts-trueskill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscttcper%2Fts-trueskill/lists"}