Skip to main content

Add your description here

Project description

:chess_pawn: EloGrad

Extended Elo model implementation.

EloGrad leverages the framing of the Elo rating system as logistic regression with stochastic gradient descent (see this blog for a nice walkthrough) to offer a collection of extensions to the rating system. All models are scikit-learn compatible.

:book: Installation

You can install elo-grad with:

pip install elo-grad

:stopwatch: Quick Start

Detailed example notebooks are provided in the examples/ directory. To install any extra dependencies required to run the notebooks install with:

pip install elo-grad[examples]

:clipboard: Minimal Example

from elo_grad import EloEstimator

# Input DataFrame with sorted index of Unix timestamps
# and columns entity_1 | entity_2 | score
# where score = 1 if player_1 won and score = 0 if
# player_2 won.
df = ...
estimator = EloEstimator(
    k_factor=20, 
    default_init_rating=1200,
    entity_cols=("player_1", "player_2"),
    score_col="result",
)
# Get expected scores
expected_scores = estimator.predict_proba(df)
# Get final ratings (of form (Unix timestamp, rating))
ratings = estimator.model.ratings

:compass: Roadmap

In rough order, things we want to add are:

  • Proper documentation
  • Support for additional features, e.g. home advantage
  • Regularization (L1 & L2)
  • Support for Polars
  • Head-to-head ratings
  • Other optimizers, e.g. momentum
  • Poisson model support
  • Support for draws
  • Extend plotting support, e.g. plotly

:blue_book: References

  1. Elo rating system: https://en.wikipedia.org/wiki/Elo_rating_system
  2. Elo rating system as logistic regression with stochastic gradient descent: https://stmorse.github.io/journal/Elo.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elo_grad-0.2.1.tar.gz (200.4 kB view details)

Uploaded Source

Built Distribution

elo_grad-0.2.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file elo_grad-0.2.1.tar.gz.

File metadata

  • Download URL: elo_grad-0.2.1.tar.gz
  • Upload date:
  • Size: 200.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.4.20

File hashes

Hashes for elo_grad-0.2.1.tar.gz
Algorithm Hash digest
SHA256 190f223520337d487207541ad26a433abf1d936e0338a6ba9c12dde0ddcce9b5
MD5 9f5efecea9c7fb6f9c8e244accabc592
BLAKE2b-256 6b5bed343c5d41ebe644366180c94dfb7f19fbfa57afc3a793a9fff608770d7d

See more details on using hashes here.

File details

Details for the file elo_grad-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: elo_grad-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.4.20

File hashes

Hashes for elo_grad-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b216d9f296971845872e1d21195619f78492a0c18eb03d34e0a8e77ada106e3a
MD5 b3d26c8da2c8ddf7d2ddaa1fa307cd92
BLAKE2b-256 1d808a65c36e95330f2b633c9f4593aa7075d81780c5904b2356784d50d6872d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page