Giter VIP home page Giter VIP logo

elo's Introduction

Elo Python Ranking

The elo formula is a method of ranking chess players by calculating relative skill. It has found successful applications in team sports. A python package has been developed to calulate expected probability of victory based on prior skill rankings and update the rankings following a result.

from elosports.elo import Elo
eloLeague = Elo(k = 20)
eloLeague.addPlayer("Daniel", rating = 1600)
eloLeague.addPlayer("Harry")
eloLeague.expectResult(eloLeague.ratingDict['Daniel'],eloLeague.ratingDict['Harry'])

The difference in ratings (relative score) determines the probability of victory in a potential match-up. After a result concludes, the difference determines how many points the victor gains and defeated loses. A few points transfer from the loser to the winner when the higher rated player wins. Many points transfer when the lower-rated player wins.

The long-term average for teams is 1500 and values generally range from 1200 to 1800.

k-value

eloLeague = Elo(k = 20)

The k-factor determines how the rating reacts to new results. If the value is set too high the ratings will jump around too much and set too low it will take a long time to recognize greatness.

g-value

eloLeague = Elo(k= 20, g = 1)

The g-value or margin of value multiplier introduces a way of preventing autocorrelation.

Home-field Advantage

eloLeague = Elo(k = 20, homefield = 100)

Home-field advantage is pre-determined. In the NBA and NFL, FiveThirtyEight gives home-court advantages of around 100 Elo points. In the case of two evenly-matched teams, Elo favors the home team.

Expected Score

The formula for determining the expected probabilistic score can found: https://en.wikipedia.org/wiki/Elo_rating_system

eloLeague.expectResult(eloLeague.ratingDict['Daniel'],eloLeague.ratingDict['Harry'])

Update Rankings

eloLeague.gameOver(winner = "Daniel, loser = "Harry")

Tutorial

A tutorial with NFL (American football) simulated Elo rankings can be found in the tutorial section.

elo's People

Contributors

ddm7018 avatar

Watchers

 avatar

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.