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
- 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.2.3.tar.gz
(200.4 kB
view details)
Built Distribution
elo_grad-0.2.3-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file elo_grad-0.2.3.tar.gz
.
File metadata
- Download URL: elo_grad-0.2.3.tar.gz
- Upload date:
- Size: 200.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4812c0de2f417d4a2d71b0c722548c104b5bc6299d9b2c7144261edcbe39d950 |
|
MD5 | 87725468b6007b668f6aa3f61eeb66ce |
|
BLAKE2b-256 | f71c65fa4d2d303df3db3e9746908a06dd93fb3b1ecdc9169fe7c72bb267404e |
File details
Details for the file elo_grad-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: elo_grad-0.2.3-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98dd8c08b0e40894c4507951ccfb123325dc5deaeb1b26d9d278d6d8b5f0ef24 |
|
MD5 | 17c0b6ea7311b8e5152642596b518d38 |
|
BLAKE2b-256 | 3e750da01b31c815d8356922690b749a4b648a1748c699fe86268c13f5a40e75 |