npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whr

v0.3.2

Published

A system for ranking game players by skill, based on Rémi Coulom's [Whole History Rating](http://remi.coulom.free.fr/WHR/WHR.pdf) algorithm, with modifications to support handicaps.

Downloads

3

Readme

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.new({w2: 17})