Skip to content

A system for ranking game players by skill, based on Rémi Coulom's Whole History Rating algorithm.

License

Notifications You must be signed in to change notification settings

zeroclutch/whr-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whole History Rating

A system for ranking game players by skill, based on Rémi Coulom's Whole History Rating algorithm, with modifications to support handicaps.

This is a port of GoShrine's implementation in Typescript.

Installation

npm i whr

Usage

const { WholeHistoryRating } = require('whr')

const whr = new WholeHistoryRating()

// WholeHistoryRating#createGame arguments: black player name, white player name, winner, day number, handicap
// Handicap should generally be less than 500 elo
whr.createGame("shusaku", "shusai", "B", 1, 0)
whr.createGame("shusaku", "shusai", "W", 2, 0)
whr.createGame("shusaku", "shusai", "W", 3, 0)

// Iterate the WHR algorithm towards convergence with more players/games, more iterations are needed.
whr.iterate(50)

// Results are stored in one triplet for each day: [day_number, elo_rating, uncertainty]
console.log(whr.ratingsForPlayer("shusaku"))
/*  Output:
    [[1, -43, 84], 
    [2, -45, 84], 
    [3, -45, 84]]
*/

console.log(whr.ratingsForPlayer("shusai"))
/*  Output:
    [[1, 43, 84], 
    [2, 45, 84], 
    [3, 45, 84]]
*/

Optional Configuration

One of the meta parameters to WHR is the variance of rating change over one time step, :w2, which determines how much that a player's rating is likely change in one day. Higher numbers allow for faster progress. The default value is 300, which is fairly high.

whr = new WholeHistoryRating({w2: 17})

About

A system for ranking game players by skill, based on Rémi Coulom's Whole History Rating algorithm.

Resources

License

Stars

Watchers

Forks

Packages

No packages published