Views
No views yet
TL;DR — This repository hosts the production models behind ruslanmv.com/sports-trends. Each sport gets the algorithm best suited to its dynamics, every model outputs probability-calibrated win/draw/loss odds, and the whole training pipeline is leakage-safe by construction. Models are retrained automatically and published under<sport>/latest/.📊 For information & entertainment only — not betting advice.
| Sport | Outcome space | Model | Why this model |
|---|---|---|---|
| ⚽ Football | home / draw / away (3-way) | HistGradientBoostingClassifier | Draws + non-linear Elo×form interactions; gradient boosting handles the 3-way target and feature interactions best. |
| 🏀 Basketball | home / away (2-way) | LogisticRegression | No draws and a strong linear Elo signal — calibrated logistic regression gives clean, well-behaved probabilities. |
| 🎾 Tennis | player 1 / player 2 (2-way) | GradientBoostingClassifier | Head-to-head, surface and form interactions are non-linear; GBDT captures them on short player histories. |
| 🏏 Cricket | home / away (2-way) | RandomForestClassifier | Format-dependent, noisy results; bagged trees are robust to variance and outliers. |
| 🏆 World Cup / international | 90-min result + to-advance | Elo + tournament model | Adds host advantage, neutral venue, confederation strength and stage importance, plus an extra-time/penalties "who advances" layer. |
Free sports APIs Feature engineering Per-sport model
┌──────────────────┐ normalize ┌────────────────────┐ infer ┌────────────────┐
│ fixtures, results│ ───────────▶ │ Elo · form · H2H · │ ──────▶ │ calibrated │
│ (multi-source) │ canonical │ rest · home adv · │ │ probabilities │
│ + offline mock │ schema │ league/social │ │ + explanation │
└──────────────────┘ └────────────────────┘ └───────┬────────┘
│ ▲ │
│ leakage guard: only matches with date < fixture date │
└──────────────────────────────────────────────────────────── publish JSONdate < fixture.match_date. A regression test plants a future blowout and asserts the
pre-match Elo is unchanged — guaranteeing no peeking at the result.<sport>/latest/
model.pkl # calibrated scikit-learn estimator (joblib)
feature_schema.json # ordered feature names + dtypes expected at inference
metrics.json # holdout accuracy + log loss for this version
README.md # per-sport card
registry/
latest_versions.json # production pointer: sport -> {version, path, metrics}registry/latest_versions.json is the source of truth for which version is live.1import json
2import joblib
3import pandas as pd
4from huggingface_hub import hf_hub_download
5
6REPO = "ruslanmv/sports-trends-models"
7SPORT = "football"
8
9model = joblib.load(hf_hub_download(REPO, f"{SPORT}/latest/model.pkl"))
10schema = json.load(open(hf_hub_download(REPO, f"{SPORT}/latest/feature_schema.json")))
11
12# Build one row with the features named in feature_schema.json (same order).
13features = {name: 0.0 for name in schema["features"]}
14X = pd.DataFrame([features])[schema["features"]]
15
16proba = model.predict_proba(X)[0]
17print(dict(zip(model.classes_, proba.round(3))))
18# e.g. {'home': 0.58, 'draw': 0.18, 'away': 0.24}1import json
2from huggingface_hub import hf_hub_download
3reg = json.load(open(hf_hub_download("ruslanmv/sports-trends-models",
4 "registry/latest_versions.json")))
5print(reg["football"]) # -> {'version': ..., 'path': 'football/latest/', 'metrics': {...}}metrics.json (holdout accuracy and calibrated
log loss) produced on a chronological hold-out split. Sports outcomes are
high-variance, so treat metrics as relative model-quality signals rather than
guarantees: a well-calibrated football model typically lands meaningfully above the
3-way random/majority baseline, and log loss is the metric we optimise for because
calibration matters more than raw accuracy for probabilistic predictions.Numbers in themodel-indexabove are indicative placeholders; the authoritative, per-version metrics always live in each<sport>/latest/metrics.json.
1@software{magana_sports_trends_2026,
2 author = {Ruslan Magana Vsevolodovna},
3 title = {Sports-Trends: Calibrated, leakage-safe sports outcome models},
4 year = {2026},
5 url = {https://huggingface.co/ruslanmv/sports-trends-models},
6 note = {Live dashboard: https://ruslanmv.com/sports-trends/}
7}