Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- sports
|
| 6 |
+
- football
|
| 7 |
+
- soccer
|
| 8 |
+
- premier-league
|
| 9 |
+
- tabular
|
| 10 |
+
- poisson
|
| 11 |
+
- expected-goals
|
| 12 |
+
- statsmodels
|
| 13 |
+
library_name: statsmodels
|
| 14 |
+
pipeline_tag: summarization
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# ⚽ EPL-Pulse_v1
|
| 18 |
+
**English Premier League Match Outcome & Goals Predictor**
|
| 19 |
+
|
| 20 |
+
`EPL-Pulse_v1` is a **leakage-safe football match prediction model** trained on historical English Premier League data (1993/94 → 2024/25 mid-season).
|
| 21 |
+
|
| 22 |
+
The model estimates:
|
| 23 |
+
- **Expected goals (xG)** for home and away teams
|
| 24 |
+
- **Outcome probabilities**:
|
| 25 |
+
- Home Win
|
| 26 |
+
- Draw
|
| 27 |
+
- Away Win
|
| 28 |
+
- **Scoreline probability distribution** (e.g., 1–0, 2–1, 0–0)
|
| 29 |
+
|
| 30 |
+
This repository contains the **production-ready model artifacts** used by the public Hugging Face Space.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## 🔍 What’s inside this repository
|
| 35 |
+
|
| 36 |
+
### Model artifacts
|
| 37 |
+
- `home_goals_model.pkl`
|
| 38 |
+
Poisson regression model for **home team goals**
|
| 39 |
+
- `away_goals_model.pkl`
|
| 40 |
+
Poisson regression model for **away team goals**
|
| 41 |
+
- `feature_list.pkl`
|
| 42 |
+
Ordered list of features used during training
|
| 43 |
+
- `team_state.pkl`
|
| 44 |
+
Latest per-team snapshot used for inference:
|
| 45 |
+
- Elo rating
|
| 46 |
+
- Rolling goals-for / goals-against
|
| 47 |
+
- Timestamp of last update
|
| 48 |
+
|
| 49 |
+
> `team_state.pkl` enables **fast production inference** without recomputing rolling features at request time.
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## 🧠 Modeling approach
|
| 54 |
+
|
| 55 |
+
### Model type
|
| 56 |
+
- **Poisson Generalized Linear Models (GLM)**
|
| 57 |
+
(one model for home goals, one for away goals)
|
| 58 |
+
|
| 59 |
+
### Why Poisson?
|
| 60 |
+
- Goals are discrete counts
|
| 61 |
+
- Well-established baseline in football analytics
|
| 62 |
+
- Interpretable and deployable
|
| 63 |
+
- Produces full scoreline probability distributions
|
| 64 |
+
|
| 65 |
+
### Outcome probabilities
|
| 66 |
+
Win / Draw / Loss probabilities are derived from the joint scoreline distribution:
|
| 67 |
+
\[
|
| 68 |
+
P(H=i, A=j) = \text{Poisson}(i|\lambda_H) \times \text{Poisson}(j|\lambda_A)
|
| 69 |
+
\]
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## 📊 Features used (leakage-safe)
|
| 74 |
+
|
| 75 |
+
All features are **computed strictly from matches played before kickoff**.
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
This design prevents **data leakage** and supports reliable backtesting.
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
## 🚀 Quickstart (Python)
|
| 84 |
+
|
| 85 |
+
### 1️⃣ Install dependencies
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
from huggingface_hub import hf_hub_download
|
| 89 |
+
import joblib
|
| 90 |
+
|
| 91 |
+
REPO_ID = "YOUR_USERNAME/EPL-Pulse_v1"
|
| 92 |
+
|
| 93 |
+
home_path = hf_hub_download(REPO_ID, "home_goals_model.pkl")
|
| 94 |
+
away_path = hf_hub_download(REPO_ID, "away_goals_model.pkl")
|
| 95 |
+
feat_path = hf_hub_download(REPO_ID, "feature_list.pkl")
|
| 96 |
+
state_path = hf_hub_download(REPO_ID, "team_state.pkl")
|
| 97 |
+
|
| 98 |
+
home_model = joblib.load(home_path)
|
| 99 |
+
away_model = joblib.load(away_path)
|
| 100 |
+
feature_list = joblib.load(feat_path)
|
| 101 |
+
team_state = joblib.load(state_path)
|