skillratings
Skillratings allows you to calculate the player's skill instantly, or after tournaments/rating periods with a list of results using a variety of known and lesser known skill rating algorithms.
Currently supported algorithms:
- Elo
- Glicko
- Glicko-2
- TrueSkill
- Weng-Lin (Bayesian Approxmation Method)
- DWZ (Deutsche Wertungszahl)
- Ingo
They are mainly known from their usage in chess and online games.
Installation
Add the following to your Cargo.toml file:
[]
= "0.13.0"
Basic Usage
Below is the most basic use case for each supported algorithm, in a 1-vs-1 format.
Each rating algorithm has many more associated functions, for example getting a rating using a list of outcomes or getting expected scores.
Head over to the documentation for more information.
Elo rating system
extern crate skillratings;
use ;
let player_one = EloRating ;
let player_two = EloRating ;
// The outcome is from the perspective of player one.
let outcome = WIN;
// The config allows you to change certain adjustable values in the algorithms.
let config = new;
let = elo;
assert!;
assert!;
Glicko rating system
use ;
let player_one = GlickoRating ;
let player_two = GlickoRating ;
// The outcome is from the perspective of player one.
let outcome = WIN;
// The config allows you to change certain adjustable values in the algorithms.
let config = new;
let = glicko;
assert!;
assert!;
assert!;
assert!;
Glicko-2 rating system
extern crate skillratings;
use ;
let player_one = Glicko2Rating ;
let player_two = Glicko2Rating ;
// The outcome is from the perspective of player one.
let outcome = WIN;
// The config allows you to change certain adjustable values in the algorithms.
let config = new;
let = glicko2;
assert!;
assert!;
assert!;
assert!;
TrueSkill rating system
Caution regarding usage of TrueSkill: Microsoft permits only Xbox Live games or non-commercial projects to use TrueSkill(TM). If your project is commercial, you should use another rating system included here.
use ;
let player_one = TrueSkillRating;
let player_two = TrueSkillRating ;
// The config allows you to change certain adjustable values in the algorithms.
let config = new;
// The outcome is from the perspective of player one.
let outcome = WIN;
let = trueskill;
assert!;
assert!;
assert!;
assert!;
Weng-Lin rating system
(A Bayesian Approximation Method for Online Ranking)
use ;
let player_one = WengLinRating ;
let player_two = WengLinRating ;
// The config allows you to change certain adjustable values in the algorithms.
let config = new;
// The outcome is from the perspective of player one.
let outcome = WIN;
let = weng_lin;
assert!;
assert!;
assert!;
assert!;
DWZ (Deutsche Wertungszahl) rating system
use ;
let player_one = DWZRating ;
let player_two = DWZRating ;
// The outcome is from the perspective of player one.
let outcome = WIN;
let = dwz;
assert!;
assert_eq!;
assert!;
assert_eq!;
Ingo rating system
use ;
let player_one = IngoRating ;
let player_two = IngoRating ;
// The outcome is from the perspective of player one.
let outcome = WIN;
let = ingo;
assert!;
assert!;
License
This project is licensed under the MIT License.