ai-prediction-workflow
Logic and process for AI-driven lottery analysis and prediction.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Logic and process for AI-driven lottery analysis and prediction.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
多模型预测引擎详解,包含统计学、机器学习、深度学习及启发式算法模型 (Models A-J)。
本项目使用的 AI API 配置、技术指标规范及项目架构参考手册。
彩票数据管理手册,包含数据抓取、增量更新逻辑及多彩种数据预处理规则。
中国福利彩票与体育彩票官方规则手册,包含购彩、开奖、中奖标准及兑奖信息。
| name | AI Prediction Workflow |
| description | Logic and process for AI-driven lottery analysis and prediction. |
This skill documents the technical flow and logic for AI model integration within the Lottery project.
app.py -> render_ai()funcs/ai_helper.py -> prepare_lottery_data_text(), generate_ai_prediction(), _build_prediction_prompt()google-genai (Gemini), openai (NVIDIA, MiniMax, DashScope)The user selects a lottery and the number of periods (N) to analyze. app.py extracts the latest N rows from the historical CSV data.
funcs/ai_helper.py converts the raw dataframe rows into a human-readable text format suitable for Large Language Models (LLMs). This includes draw numbers, red balls, and blue balls.
The system constructs a detailed "Prompt" (instruction book) for the AI. Key components:
The system routes the prompt to the selected AI provider:
Vertex AI or Gemini API.OpenAI client using the https://api.deepseek.com base URL.OpenAI client using provider-specific base URLs and API keys.The AI returns a Markdown report containing:
API keys must be stored in the .Renviron file or system environment variables:
GEMINI_API_KEYDEEPSEEK_API_KEYNV_API_KEY (NVIDIA)MINIMAX_API_KEYALIYUNCS_API_KEY (DashScope)项目使用 request_data_update.py 进行增量数据更新,并有一套严格的期号(Issue)规范化流程,以解决不同来源数据格式不一致的问题。
normalize_issue)根据彩种所属机构,系统会自动转换并统一期号格式:
YYNNN)。
2026022 (7位) $\rightarrow$ 26022 (5位);7001 (4位) $\rightarrow$ 07001 (5位)。YYYYNNN)。
26024 (5位) $\rightarrow$ 2026024 (7位)。request_data_update.py)data/ 目录下各彩种 CSV,获取最大期号,并调用 normalize_issue 进行规范化。get_latest_issue_from_system 获取官方接口最新期号,并同样进行规范化。normalize_issue,确保存入本地 CSV 的期号格式始终保持项目约定的标准。ai_batch_predict.py)系统支持全彩种每日自动预测。当数据同步完成后,ai_batch_predict.py 会遍历所有配置的彩种,调用 Gemini 1.5 Pro/Flash 模型进行分析,并将生成的预测报告(带时间戳)保存在 data/ai_predictions_history.csv 中,供前端(如 app.py 的历史归档页面)展示。
multi_model.py)项目集成了一套基于传统统计学与现代机器学习的本地预测引擎,支持多种模型的并行分析与综合推荐。
根据彩种真实的摇奖机制,系统采用两种不同的建模策略:
双奖池模式 (Separate Pool = True):
[红球位向量] + [蓝球位向量](例如双色球为 33+16=49位)。单奖池模式 (Separate Pool = False):
引擎动态提取以下核心特征:
系统并行运行四种性质不同的模型:
综合推荐 (Ensemble): 采用“基于回测命中率权重的标准化概率融合”方案。仅筛选历史回测表现优异的模型进入综合池,通过 Min-Max 标准化消除不同模型概率分布的差异,生成最终建议。