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.0.tar.gz
(196.3 kB
view details)
Built Distribution
elo_grad-0.2.0-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file elo_grad-0.2.0.tar.gz
.
File metadata
- Download URL: elo_grad-0.2.0.tar.gz
- Upload date:
- Size: 196.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe640fc3c128b089a9daf6ff88867994c672d14167a010a0cb4c532f6b5d8b93 |
|
MD5 | 450a4c023064a1a86bb7df837c294e25 |
|
BLAKE2b-256 | 299c6e7127ae36d2e4fc67de68afc2d4e8ac35c3d04c1217c989fd3dc5943a35 |
File details
Details for the file elo_grad-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: elo_grad-0.2.0-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 | 68839e53baaa4846c34e3e89075f6e9af1a7d7ab398c317f9942f9959b2a2861 |
|
MD5 | 1fb78e92af8784b75b1cb8db23d1659f |
|
BLAKE2b-256 | b41a6caaed0f71e899947c31f02e28fb8c04d4174b2c056b22de653aa1bd2733 |