360 Secure SkillHub
360 安全技能中心

Worldcup Predictor

基于赛程缓存、小组积分与 Elo 评分模型预测世界杯比赛结果,输出球队强度、胜/平/负概率与预测比分,支持按对阵、球队、当日赛程查询并更新赛程缓存;可选用第三方足球数据 API 补充数据。

ravenquasar
ravenquasar
热度 74.29
最近更新 2026-06-15 07:24:58
分类:生活依赖:代码执行 / 读写文件 / 第三方 API / 联网浏览搜索应用场景:研究 / 报告撰写 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add worldcup-predictor
Metadata
name
worldcup-predictor
description
FIFA World Cup match predictor: dual-mode score model + Elo ratings. Win/draw/loss probabilities & score predictions.

World Cup Predictor

A FIFA World Cup match prediction tool based on real schedule data, group standings, and an Elo rating model.

Data Sources

Primary: NetEase Sports

Secondary: BALLDONTLIE FIFA World Cup API

  • Website: https://fifa.balldontlie.io
  • API Base URL: https://api.balldontlie.io/fifa/worldcup/v1
  • Auth: HTTP Header Authorization: YOUR_API_KEY
  • Free tier: team list, stadium list

API Key Configuration

Store your API key in ~/.openclaw/openclaw.json:

{
  "skills": {
    "worldcup-predictor": {
      "api_key": "***"
    }
  }
}

Prediction Model (v2.3)

Dual-Mode Score Prediction

The key innovation: different models for different match types.

Mode A — Blowout Mode (strength gap ≥ 15 points) Uses an attack × defense weakness product model with a collapse factor:

  • Strong team's attack λ is multiplied by the weak team's defensive weakness
  • When a weak team (strength < 65) faces a strong team (strength > 85), weakness is amplified by the gap
  • Collapse factor: weakness × (1 + gap × 0.007) — e.g. gap=34 → 1.24x multiplier
  • Result: correctly predicts blowouts like Germany 6-1 Curaçao (actual: 7-1)

Mode B — Balanced Mode (strength gap < 15 points) A compressed Poisson model that keeps total goals reasonable:

  • Base λ is compressed to 1.0-2.0 range
  • Opponent strength provides gentle moderation
  • Prevents over-predicting goal fests in close matches
  • Result: correctly predicts close matches like Netherlands 3-2 Japan (actual: 2-2)

Multi-Dimensional Elo Rating Model

  1. Base Strength — 48 teams with preset strength scores (50-95), mapped to Elo 1300-2000
  2. Group Standings — Auto-calculated from match data; rank bonuses (#1: +20, #2: +10, #3: -5, #4: -15)
  3. Recent Form — Completed match performance (win +3/draw +1 pts), +5 Elo per point
  4. Goal Data — Average goals scored/conceded calibrate Poisson λ parameters
  5. Tournament Draw Rate — Real-time tournament draw rate weighted 50:50 with model draw probability
  6. Draw Bias Correction — When draw probability is high and attacking data is close, score tilts toward a draw
  7. Home Advantage — +70 Elo

Prediction Output Format

📊 Match Prediction
══════════════════════════════════════
🇦🇷 Argentina vs 🇧🇷 Brazil

📈 Team Strength:
🇦🇷 Argentina [█████████░] 95
🇧🇷 Brazil    [█████████░] 93

🏅 Group Ranking:
🇦🇷 Argentina: Group #1
🇧🇷 Brazil:    Group #2

⚽ Recent Data:
🇦🇷 Argentina: 2.0 goals/game avg
🇧🇷 Brazil:    1.0 goals/game avg

📊 Win Probability
🇦🇷 Argentina Win: 48.2%
🤝 Draw:           32.2%
🇧🇷 Brazil Win:    19.6%

⚽ Predicted Score: 🇦🇷 2 - 1 🇧🇷

📈 Tournament Draw Rate: 38% (reference)

🔑 Key Analysis
  • Argentina ranked higher in group
  • Argentina in better form
  • Predicted narrow Argentina win

Backtest Accuracy

v2.3 achieved 78% (7/9) correct win/draw/loss direction on completed matches.

Usage

Predict a match

python3 predict.py match Australia Turkey

Predict a team's next match

python3 predict.py team Brazil

View group standings (auto-calculated)

python3 predict.py standings

Today's matches + predictions

python3 predict.py today

View full schedule

python3 predict.py schedule

Update schedule cache

After fetching latest schedule from NetEase:

python3 predict.py update

Scripts

scripts/predict.py

Core prediction script with the following commands:

Command Description
teams List all 48 teams (grouped by confederation)
standings Auto-calculate group standings
schedule View full match schedule
today Today's matches + predictions
match <home> <away> Predict a specific match
team <name> Predict a team's next match
update Update schedule cache
--upcoming Flag for schedule: show only upcoming matches

Configuration

The script reads the API key from ~/.openclaw/openclaw.json (optional, for BALLDONTLIE data enrichment):

{
  "skills": {
    "worldcup-predictor": {
      "api_key": "***"
    }
  }
}

File Structure

worldcup-predictor/
├── SKILL.md
└── scripts/
    ├── predict.py      # Core prediction script
    └── schedule.json   # Schedule cache (auto-generated)