Skip to main content

Add your description here

Project description

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.

Installation

You can install elo-grad with:

pip install elo-grad

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]

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.transform(df)
# Get final ratings (of form (Unix timestamp, rating))
ratings = estimator.model.ratings

Roadmap :compass:

In rough order, things we want to add are:

  • Scikit-learn compatibility
  • Proper documentation
  • Plotting support
  • 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

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.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

elo_grad-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for elo_grad-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f170dc4d76e014d67330e4cafa5b7389067a7a1125933fe3a8e2490a4736c21
MD5 d13fd43a9bda67eb40bf843524f10ab5
BLAKE2b-256 88ea46b77f53d71dd6cc129f00defb588be56041a70a647162401e44a82b01db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elo_grad-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac4eca2b702d056b8c33cd19f48e8bbfa35e59dea88d9f1b4619efc0ea841a94
MD5 3670806dce4b0f68be0b139dd32371f2
BLAKE2b-256 9cbf9d18dfa4d4df0e6f16c95af5824501023c2d1165af2bf18aae6b2bf8803a

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