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:

uv add git+https://github.com/cookepm86/elo-grad

Quick Start

Minimal Example

from elo_grad import LogisticRegression, SGDOptimizer

model = LogisticRegression(beta=200, default_init_rating=1200, init_ratings=None)
sgd = SGDOptimizer(k_factor=20)

# Check initial weights (NOTE: time is None)
print("Initial weights:")
print(model.ratings["Tom"], model.ratings["Jerry"])

# Update after Tom beats Jerry at time t=1
sgd.update_model(model, y=1, entity_1="Tom", entity_2="Jerry", t=1)

# Check new weights
print("\nNew weights:")
print(model.ratings["Tom"], model.ratings["Jerry"])

Output:

Initial weights:
(None, 1200) (None, 1200)

New weights:
(1, 1210.0) (1, 1190.0)

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for elo_grad-0.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 2163d3fb86ab5c3c484d4cd14452706d961cb306e0ff419d6cf21ed8b1f7d43d
MD5 1f98299f5676f950b0b1b18452b75abf
BLAKE2b-256 8cf5f42187a5e54406de4ec7300ee3eb3f24bfee0b6458465bee27d5a9e864b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elo_grad-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ecf42daa16debc399d3266fb6fe88afb25f88dcbbd3ed8e4c944554bb78971e
MD5 f665fb7628854a4496f0b6acb9edc77f
BLAKE2b-256 588a054e24b54000b5e0a8045b195ed75a380b2c49bf4957deafd7c117b87510

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