← 返回 Skills 市场
deloyong

yyWorldCup

作者 DeloYong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
39
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install yy-world-cup
功能描述
Use when predicting World Cup match results and generating China Sports Lottery betting strategies, including injury factor analysis, weather impact assessme...
使用说明 (SKILL.md)

增强版世界杯预测器 v2.0

Overview

基于双模式评分模型和Elo评级系统的增强型世界杯赛事预测工具,在原有预测能力基础上新增球员伤病状态、上场概率、近期竞技状态、比赛日天气影响、战术克制关系、小组排名激励等核心因子,输出精准比赛预测结果和符合中国体育彩票规则的双模式购票策略(胜率最高策略/激进策略)。

v2.0 改进要点

  • ✅ 模块化重构:data/factors/strategy/validator 四层架构
  • ✅ 修复赔率映射Bug:之前所有赔率都返回20.0,现已修复
  • ✅ 补全缺失因子:战术克制关系、小组排名激励、攻防数据
  • ✅ 支持中立球场:世界杯场景下自动降低主场优势
  • ✅ balldontlie FIFA API 完整封装 + 文件缓存
  • ✅ 完整单元测试覆盖(16个测试用例全部通过)
  • ✅ 2022世界杯历史回测验证

When to Use

  • 需要预测世界杯单场或多场比赛结果时
  • 需要生成中国体育彩票足球竞猜购票策略时
  • 需要考虑球员伤病、天气等额外影响因子时
  • 需要对比不同投注策略的风险收益时

When NOT to use

  • 非世界杯赛事预测(可适配但针对性优化不足)
  • 用于非法赌博用途(仅支持合法中国体育彩票分析)
  • 构成任何投注建议(所有结果仅供参考,投注风险自担)

目录结构

world-cup-predictor-enhanced/
├── SKILL.md                       # 本文件
├── predictor/
│   ├── __init__.py                # 包入口
│   ├── core.py                    # 双模式预测引擎
│   ├── factors.py                 # 10类预测因子计算
│   ├── data/                      # 数据接入层
│   │   ├── models.py              # 数据模型定义
│   │   ├── api_client.py          # balldontlie FIFA API客户端
│   │   └── cache.py               # 文件缓存机制
│   ├── strategy/                  # 策略引擎
│   │   ├── lottery.py             # 体彩5种玩法
│   │   ├── conservative.py        # 胜率最高策略
│   │   └── aggressive.py          # 激进策略
│   └── validator/                 # 验证模块
│       └── backtest.py            # 2022历史回测
├── tests/
│   └── test_factors.py            # 单元测试
└── data/                          # 运行时数据
    └── cache/                     # API响应缓存

Core Pattern

双模式预测模型

球队实力分差 ≥ 15分 → 爆冷模式(爆冷因子+客胜加权提升)
球队实力分差 \x3C 15分 → 平衡模式(泊松模型+动态平局概率)

预测因子体系(共10类)

因子类别 权重占比 说明
基础球队实力(Elo) 35% 映射到1600-1950 Elo区间
球员伤病与上场概率 15% 主力+位置差异化权重,0.80-1.20系数
近期比赛状态 12% 近5场加权评分,0.90-1.10系数
比赛日天气影响 8% 温度/降水/风力对不同战术的影响
小组排名与奖金激励 7% 出线形势对球队战意的影响,0.95-1.05
平均进球/失球数 7% 攻防数据综合差值,0.92-1.08
主场优势 5% 真实主场70 Elo / 中立球场25 Elo
实时赛事平局率 5% 同阶段赛事平局率加权校正
平局偏差校正 4% 历史对战平局偏差校正
战术克制关系 2% 战术风格相克关系,0.97-1.03

中国体彩玩法支持

  1. 胜平负:全场90分钟(含伤停补时)主队胜/平/负
  2. 让球胜平负:比赛结果加减让球数后判定
  3. 比分:全场具体比分预测
  4. 总进球数:全场两队总进球数预测
  5. 半全场:上半场+全场胜平负组合预测

Quick Reference

输出结果结构

{
  "match_info": {...},
  "weather_info": {...},
  "injury_report": {...},
  "analysis": {
    "home_elo": 1920, "away_elo": 1720,
    "home_total_factor": 1.05, "away_total_factor": 0.95,
    "elo_diff": 200, "predict_mode": "爆冷模式"
  },
  "prediction": {
    "home_win_prob": "55.0%", "draw_prob": "25.0%", "away_win_prob": "20.0%",
    "predicted_scores": [...],
    "total_goals_prob": [...]
  },
  "strategies": [
    {
      "strategy_name": "胜率最高策略",
      "play_types": [...],
      "expected_win_rate": 0.65,
      "expected_odds": 1.85,
      "expected_value": 0.20
    },
    {
      "strategy_name": "激进策略",
      "play_types": [...],
      "expected_win_rate": 0.25,
      "expected_odds": 6.50,
      "expected_value": 0.63
    }
  ]
}

购票策略原则

胜率最高策略

  • 投注占比:总预算70%
  • 玩法组合:胜平负 + 让球胜平负 + 总进球数
  • 目标胜率≥65%,赔率区间1.20-2.50

激进策略

  • 投注占比:总预算30%
  • 玩法组合:比分 + 半全场 + 总进球数(2串1)
  • 目标命中率≥25%,赔率区间3.00-15.00

使用方法

命令行调用

# 运行回测验证
python3 -c "from predictor.validator import BacktestValidator; BacktestValidator().print_report(BacktestValidator().validate_2022_worldcup())"

# 运行单元测试
python3 -m unittest tests.test_factors -v

Python API调用

from predictor import (
    BalldontlieFIFAClient, WorldCupPredictor, ConservativeStrategy, AggressiveStrategy,
    Team, Stadium, MatchInfo, InjuryInfo, WeatherInfo, RecentMatch,
    TeamStyle, Position, WeatherCondition
)

# 1. 通过API获取球队
client = BalldontlieFIFAClient(api_key="your_key")
teams = client.get_teams()

# 2. 构造比赛
home = Team(id=37, name="Argentina", abbreviation="ARG",
            country_code="ARG", confederation="CONMEBOL",
            elo=1910, style=TeamStyle.TECHNICAL)
away = Team(id=53, name="Saudi Arabia", abbreviation="KSA",
            country_code="KSA", confederation="AFC",
            elo=1630, style=TeamStyle.DEFENSIVE)

match = MatchInfo(
    match_id=None, home_team=home, away_team=away,
    match_time="2022-11-22", stadium=Stadium(1, "Lusail", "Doha", "Qatar", 80000),
    stage="group", is_neutral=True
)

# 3. 预测
predictor = WorldCupPredictor()
prediction = predictor.predict(match)

# 4. 生成策略
conservative = ConservativeStrategy().generate(prediction)
aggressive = AggressiveStrategy().generate(prediction)

Common Mistakes

  1. 过度依赖历史数据:忽略即时伤病和天气变化的影响
  2. 策略风险失衡:激进策略投注占比过高导致整体亏损
  3. 忽略战意影响:小组赛最后一轮或无关痛痒的比赛
  4. 赔率陷阱:盲目跟随盘口变化,忽略基本面分析
  5. 投注过度:单场投注金额超过总预算的10%

回测结果

基于2022世界杯8场小组赛样本:

  • 加权预测准确率:约54%
  • 强队获胜命中:3/3(100%)
  • 爆冷预测能力:受限于基础Elo模型,建议接入XGBoost进一步提升

Important Disclaimer

  1. 本工具所有预测结果仅供参考,不构成任何投注建议
  2. 中国体育彩票购买请遵守国家相关法律法规,理性购彩
  3. 彩票有风险,投注需谨慎,未成年人禁止购彩
  4. 预测结果基于公开数据计算,不保证100%准确率
安全使用建议
Install only if you are comfortable providing a balldontlie API key and using locally cached sports API responses. Treat the generated lottery strategies as informational analysis, not financial advice, and review local gambling laws and personal risk before acting on any predictions.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The code and SKILL.md align around match prediction, factor analysis, backtesting, and China Sports Lottery strategy generation; it does not place bets, access betting accounts, or mutate user data.
Instruction Scope
Runtime instructions are specific to prediction and strategy workflows, with clear disclaimers that results are informational and not betting advice.
Install Mechanism
No install hooks, startup scripts, shell execution, package-install automation, or persistence mechanism were found.
Credentials
The API client sends a user-supplied balldontlie API key as an Authorization header and caches API responses locally; this is proportionate to fetching sports data but users should treat the key as sensitive.
Persistence & Privilege
Persistence is limited to a relative data/cache directory for JSON API response caching with TTL and cache-clearing helpers; there is no background worker, privilege escalation, broad indexing, or credential-store access.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install yy-world-cup
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /yy-world-cup 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
world-cup-predictor-enhanced v2.0 - Major upgrade featuring modular architecture with data, factors, strategy, and validator layers. - Fixed odds mapping bug causing all odds to return as 20.0. - Added tactical counter-relationship, group ranking incentive, and offense/defense data as predictive factors. - Improved support for neutral venues by reducing home field advantage in World Cup scenarios. - Fully encapsulates official FIFA API (balldontlie) with file-based caching. - Achieved 100% unit test coverage (16 test cases) and validated against 2022 World Cup history. - Generates dual ticket strategies for China Sports Lottery: high-win-rate (conservative) and aggressive, considering player injuries and weather impact.
元数据
Slug yy-world-cup
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

yyWorldCup 是什么?

Use when predicting World Cup match results and generating China Sports Lottery betting strategies, including injury factor analysis, weather impact assessme... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 39 次。

如何安装 yyWorldCup?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install yy-world-cup」即可一键安装,无需额外配置。

yyWorldCup 是免费的吗?

是的,yyWorldCup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

yyWorldCup 支持哪些平台?

yyWorldCup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 yyWorldCup?

由 DeloYong(@deloyong)开发并维护,当前版本 v1.0.0。

💬 留言讨论