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
- Elo rating system: https://en.wikipedia.org/wiki/Elo_rating_system
- Elo rating system as logistic regression with stochastic gradient descent: https://stmorse.github.io/journal/Elo.html
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2163d3fb86ab5c3c484d4cd14452706d961cb306e0ff419d6cf21ed8b1f7d43d |
|
MD5 | 1f98299f5676f950b0b1b18452b75abf |
|
BLAKE2b-256 | 8cf5f42187a5e54406de4ec7300ee3eb3f24bfee0b6458465bee27d5a9e864b7 |
File details
Details for the file elo_grad-0.1.0.dev1-py3-none-any.whl
.
File metadata
- Download URL: elo_grad-0.1.0.dev1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ecf42daa16debc399d3266fb6fe88afb25f88dcbbd3ed8e4c944554bb78971e |
|
MD5 | f665fb7628854a4496f0b6acb9edc77f |
|
BLAKE2b-256 | 588a054e24b54000b5e0a8045b195ed75a380b2c49bf4957deafd7c117b87510 |