0.1.5 • Published 7 years ago

elovate-rating v0.1.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

elovate-rating

A Javascript implementation of the Elo rating system.

Installation

npm install elovate-rating --save

Usage

  1. Require elovate-rating
  2. Use new Rating(ratingA, ratingB, scoreA, scoreB, kfactor) to invoke the class

Example

const Rating = require('elovate-rating');

const rating = new Rating(1500, 1500, 1, 0);

const expectedScores = rating.getExpectedScores(); // => { a: 0.5, b: 0.5 }
const newRatings = rating.getNewRatings(); // => { a: 1508, b: 1492 }
const deltaRatings = rating.getDeltaRatings(); // => { a: 8, b: -8 }

const expectedScoreA = expectedScores.a; // => 0.5
const expectedScoreB = expectedScores.b; // => 0.5

const newRatingA = newRatings.a; // => 1508
const newRatingB = newRatings.b; // => 1492

const deltaRatingA = deltaRatings.a; // => 8
const deltaRatingB = deltaRatings.b; // => -8
0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.0

7 years ago