File size: 1,834 Bytes
8c0a90e
48f8c80
 
 
 
8c0a90e
 
48f8c80
8c0a90e
 
48f8c80
9645b79
8c0a90e
 
48f8c80
 
9645b79
48f8c80
9645b79
48f8c80
9645b79
 
 
 
 
 
48f8c80
9645b79
48f8c80
 
 
 
 
 
 
 
 
 
9645b79
48f8c80
9645b79
48f8c80
9645b79
 
 
 
48f8c80
9645b79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: DramaMeter 2026
emoji: 
colorFrom: green
colorTo: red
sdk: gradio
sdk_version: 6.20.0
python_version: "3.12"
app_file: app.py
pinned: false
license: mit
short_description: Live, explainable World Cup drama analytics
---

# DramaMeter 2026

A live football analytics product for the 2026 World Cup. Pick a current, upcoming or recent fixture and get a pre-match forecast, a live drama index, the match events behind it and a post-ready take.

## What makes it real

- Loads the current 2026 World Cup schedule, scores and match statistics from ESPN Match Center's public JSON feed.
- Retrains a gradient-boosted tree ensemble on every completed tournament match at startup.
- Builds rolling pre-match features without using future match statistics.
- Reports held-out MAE and improvement over a naive mean baseline instead of hiding model quality.
- Replaces the forecast with an observed live index once a match starts.
- Shows fetch time, data source, model inputs and feature importance in the UI.

The observed target is an editorial proxy derived from fouls, cards, goals, score closeness, late goals, stage and extra time. It is not a claim about social-media sentiment and it is not betting advice.

## Run locally

```bash
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python app.py
```

Run tests with `python -m pytest`.

## Architecture

- `feed.py` — live data client, 30–45 second cache and fixture selection
- `drama.py` — rolling features, observed target and gradient-boosted model training
- `app.py` — responsive Gradio product UI and data-driven match report
- `tests/` — deterministic model and feed-contract tests

Data availability depends on ESPN's public Match Center endpoints. Cached data is used if a refresh fails after at least one successful request.