Giter Site home page Giter Site logo

glicko2's Introduction

glicko2

glicko2 crate glicko2 documentation

This crate implements the glicko2 rating system. It's a rating system appropriate for rating a team or player and is leveraged by many chess leagues.

Usage

This example comes straight from the glicko2 rating pdf:

extern crate glicko2;

use glicko2::{GameResult, GlickoRating};

fn main() {
    let example_rating = GlickoRating {
        value: 1500.0,
        deviation: 200.0,
    };
    let mut results = vec![];
    results.push(GameResult::win(GlickoRating {
        value: 1400.0,
        deviation: 30.0,
    }));
    results.push(GameResult::loss(GlickoRating {
        value: 1550.0,
        deviation: 100.0,
    }));
    results.push(GameResult::loss(GlickoRating {
        value: 1700.0,
        deviation: 300.0,
    }));
    // We are converting the result of new_rating to a GlickoRating immediately, throwing away the
    // benefits of Glicko2 over Glicko for the sake of matching the example in the glicko2 pdf.
    // In a real application, you'd likely want to save the Glicko2Rating and convert to
    // GlickoRating for display purposes only.
    let new_rating: GlickoRating = glicko2::new_rating(example_rating.into(), &results, 0.5).into();
    println!(
        "New rating value: {} New rating deviation: {}",
        new_rating.value,
        new_rating.deviation
    );
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

glicko2's People

Contributors

denialadams avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar kamilaborowska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

glicko2's Issues

Release 1.0

I'm happy with the API now, but I'd like to solicit a little more feedback before I release 1.0. If anyone tries this crate out, please share your thoughts!

Thanks :)

Database storage

Looking to use this in a project. I don't really understand the maths, but it seems that I would need to store 2 separate values (value and deviation) in order to store someone's rating in a database. Is this correct? And to display this rating, I simply display the value field, and not the deviation?

Volatility for Glicko2Rating::unrated() should be specified

Hi!

I'm using the library to calculate ratings for http://ratingupdate.info/, and was running into an issue with deviations increasing quite rapidly over time, despite the system constant being very low. After debugging a bit, I came to the conclusion that new glicko2 ratings had a volatility of 0.06 assigned was the problem.

In the original paper, the text is:

Set the player’s volatility to 0.06 (this value depends on the particular application).

This does mean that From<GlickoRating> on Glicko2Rating isn't really something that can be implemented, which has implications for the rest of the API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.