Spaces:
Running
Running
|
Download README.md from 2026worldcup/predictor: direct link, hf CLI and curl.
- Browser
- Download file 2.35 kB
-
https://huggingface.co/spaces/2026worldcup/predictor/resolve/main/README.md
- Command line
-
hf download hf://spaces/2026worldcup/predictor/README.md
-
curl -L -o README.md https://huggingface.co/spaces/2026worldcup/predictor/resolve/main/README.md
2.35 kB
metadata
title: World Cup 2026 Predictor
emoji: ⚽
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
⚽ World Cup 2026 Predictor
Dixon-Coles 模型驱动的 2026 世界杯预测平台:比分预测、观赛指南、球队数据库、 赛事模拟(48 队新赛制)与模型校准。
- 数据:martj42/international_results,49,000+ 场国际比赛(含 2026 赛程)
- 模型:penaltyblog Dixon-Coles 双泊松 + 时间衰减 + 中立场,Elo 评分
- 精度:留出验证(2024–2026,2435 场)RPS = 0.1634,原生高度校准
- 模拟:20,000 次蒙特卡洛,完整实现 12 组 + 8 最佳第三 + 32 强淘汰赛 + Annex C 第三名分配
- 栈:Next.js 15 (前端) · FastAPI (后端) · SQLite (存储)
目录结构
services/model/ 建模:ingest / elo / wcmodel / bracket / simulate / backtest / calibrate / pipeline
services/api/ FastAPI 接口(读 SQLite + 实时预测)
apps/web/ Next.js 前端(6 大页面)
data/ 原始数据 + worldcup.db (SQLite)
快速开始
1) Python 环境与数据/模型管线
cd services/model
pip install -r ../../requirements.txt
python ingest.py # 下载已就绪:入库 49k 场 + 重建 12 组
python backtest.py # 调优时间衰减 ξ 并保存模型(可选,已训练)
python pipeline.py 20000 # 评估校准 + 模拟 20000 次 + 预测全部赛程 -> SQLite
2) 后端 API(端口 8000)
cd services/api
python -m uvicorn main:app --port 8000
3) 前端(端口 3000)
cd apps/web
npm install
npm run dev # 打开 http://localhost:3000
主要接口
| 接口 | 说明 |
|---|---|
GET /api/teams /api/teams/{name} |
球队列表 / 详情(Elo、攻防、晋级概率、战绩) |
GET /api/groups /api/fixtures |
分组 / 72 场赛程含预测 |
POST /api/predict |
{home,away,neutral} → 比分概率矩阵 + 衍生盘口 |
GET /api/simulate /api/bracket |
夺冠概率表 / 32 强对阵投影 |
GET /api/calibration /api/meta |
校准指标与可靠性曲线 / 模型信息 |
重新训练或更换数据后,重跑
pipeline.py即可刷新全部网站数据。