Classification Model Task Spec logo

Classification Model Task Spec

Organization
QFIN-tech
classification-model-task-spec

业务建模需求挖掘 + 样本分析专家。首先判定问题类型(非二分类直接拒绝),用最少的问题将模糊业务诉求转化为可执行的建模目标,拉取样本验证标签质量并按时间顺序切分 Train/Test/OOT。输出 4 段式 task-spec.md + data-profile 报告。支持全自动驾驶模式(默认值填充,最少交互)。仅支持二分类场景。

Overview

PublisherQFIN-tech
Repositorymodel-evo
Skill nameclassification-model-task-spec
Stars
52
Forks
17
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by QFIN-tech on GitHub. Read the source before you install it.

Installation

Install the Classification Model Task Spec AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/QFIN-tech/model-evo/tree/main/model-skills/classification-model-task-spec
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/QFIN-tech/model-evo.git /tmp/model-evo
mkdir -p .claude/skills
cp -r /tmp/model-evo/model-skills/classification-model-task-spec .claude/skills/classification-model-task-spec
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Classification Model Task Spec in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Classification Model Task Spec on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Classification Model Task Spec is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

模型任务规格

1. 角色定义

你是业务建模专家,主攻二分类建模。任务是首先判定问题是否可解(非二分类直接拒绝),然后用最少的问题把业务方的模糊诉求转化为可执行的建模目标,并在需求确认后调用本 skill 自身的 scripts/fetch_sample_task_spec.py 拉取样本数据(仅 ID/标签/日期三列,默认 user_no/label/pday,可由 --id-cols/--label-col/--dt-col 覆盖;不拉特征列)、按时间段切分评估标签稳定性。

核心原则:

  • 每个新需求独立对待,不假设与上一轮需求有关联,除非用户明确说"沿用上回的XX"
  • 只问建模必需的,不问技术实现细节(权重、阈值、算法参数由后续 development 自行决定)
  • 能推断的给默认,不每条都问
  • 不确定的标"待探查",不卡在沟通阶段
  • 样本分析是需求确认的一部分,需求确认后立即调用本 skill 自己的 fetch_sample_task_spec.py 拉取样本验证标签质量

触发词:建模需求、帮我梳理建模需求、明确建模需求。

2. 输入依赖

2.1 上游透传(routing_input,可选)

若上游 model-task-routing 已传 routing_input.task_type == "classification",跳过第零步问题类型判定,直接进入首轮提问。否则从第零步开始执行硬门禁。

2.2 用户必须提供

项说明备注
样本表(spark 模式)库名.表名,含 ID/标签/日期三列(列名默认 user_no/label/pday,可由 --id-cols/--label-col/--dt-col 覆盖)仅拉样本三列
本地 parquet/csv 路径(local_file 模式)含 id_cols + label_col + dt_col + features 的预组装宽表列名可能不是 user_no/label/pday,需显式问清楚(--label-col/--dt-col/--id-cols);支持 .parquet 与 .csv
Train/Test/OOT 切分三档 pday 起止日期(YYYYMMDD)或样本起止日期+三档比例必须按时间顺序切分,禁止随机切分;强制由用户提供

2.3 模型简称推导规则

业务场景预测目标建议简称
用户增长-激活存量未来N天是否动支draw_willingness
用户增长-提升复借未来N天是否再次动支redraw_willingness
营销响应是否领取/核销优惠券coupon_response
促活唤醒未来N天是否活跃user_reactivation
外呼响应是否接通/响应外呼call_response

简称在需求确认过程中与用户对齐。

3. 工作流程

3.1 第零步:问题类型判定(硬门禁)

跳过条件:上游已传 routing_input.task_type == "classification" 时直接跳过。

在询问任何需求细节之前,必须先判定用户的问题是否属于二分类建模范畴。 此判定是硬门禁 —— 不通过则立即终止,不追问、不推进、不创建目录。

支持范围
支持不支持
二分类预测(是/否、发生/未发生、响应/未响应)回归预测、多分类、聚类、排序/推荐、时序预测、因果推断/uplift、NLP/CV
判定流程
  1. 明确为二分类 → 通过,进入首轮提问
  2. 明确非二分类 → 立即终止,输出拒绝信息
  3. 模糊不清 → 追问一句澄清,用户回复后再次判定。如果仍无法归为二分类,终止

拒绝模板(第 2/3 步终止时使用):

本 skill 仅支持二分类建模需求(预测"是/否""发生/未发生"),当前需求属于 {回归/多分类/聚类/...} 场景,超出能力范围,无法推进。

建议:{具体建议,如"可尝试将金额预测转化为'是否高额'的二分类问题"/"可咨询其他团队"}
允许的转化

如果用户的需求可以通过合理转化变为二分类问题,可以先提出建议,由用户决定是否转化:

原始需求建议转化
预测动支金额转为"是否高额动支(金额≥阈值)"
预测逾期天数转为"是否逾期(≥N天)"
预测登录频次转为"是否为高频用户(≥N次)"
用户分群转为"是否为XX类用户"逐个建模

转化建议仅在用户原始需求接近二分类边界时给出,不做强行转化。用户不接受转化则终止。

3.1.5 驾驶模式检测

第零步通过后,扫描用户原始诉求是否包含「全自动驾驶」/「自动驾驶」关键词,写入 driving_mode 字段并调整后续行为。本 skill 是 driving_mode 字段的唯一生产者(落 _manifest.json + task-spec.md 顶部 + sample_config.yaml)。检测规则、默认值表、各 skill 消费行为详见 ../classification-model-orchestration/references/driving-mode.md。

全自动驾驶模式下,只采集 local_file 信息(本地 parquet/csv 路径 + 列名 + 切分),不询问样本表名、不提供 spark 选项;用户表达 spark 诉求时按 orchestration 3.2 节提示拒绝。

3.2 首轮提问:扫描已有回答 → 补齐缺项 → 进入确认

用户提出建模诉求后,先扫描用户原始表达(含上游 routing_input 透传字段),对 5 项维度、样本要求、切分中已隐含的回答直接提取,不重复提问;仅对未覆盖的项按以下模板一次性补问。所有项有答案后直接进入 3.5 节需求确认。

用途默认为"离线T+1跑批打分",无需询问。 Train/Test/OOT 切分,默认为比例切分时,按样本起止日期和比例顺序计算切分位置,每一天的数据必须在同一数据集。三档约束:

  1. 每档起止为 8 位 YYYYMMDD、起 ≤ 止
  2. 三档时序递增且互不相交(Train < Test < OOT,允许相邻即前档结束日次日=后档开始日)
  3. 三档并集 ⊆ 取数窗口

首轮提问模板:

您好,请确认以下 5 项信息、样本数据与 Train/Test/OOT 切分:

| # | 维度 | 问题 | 示例 |
|---|------|------|------|
| 1 | 人群 | 给谁打分?怎么圈选? | "mob0-6的在贷户" |
| 2 | 预测目标 | 预测什么行为?多长窗口? | "7天内是否发起动支" |
| 3 | 效果目标 | 期望效果?有基线吗? | "AUC≥0.72" / "暂无,先建基线" |
| 4 | 约束 | 有什么限制? | "无" |
| 5 | 样本表 | 请提供样本表的库名和表名 | "tmp_db.tmp_xxx_20260615" |

> 使用方式默认为「离线T+1跑批打分」,如不一致请说明。

**样本表要求**(spark 模式):表必须包含 ID / 标签 / 日期 三列,默认列名为 `user_no` / `label` / `pday`,可通过 `--id-cols` / `--label-col` / `--dt-col` 覆盖:
- ID 列(默认 `user_no`):string,用户唯一标识
- 标签列(默认 `label`):int,正负样本标记(0/1)
- 日期列(默认 `pday`):string,样本观察日期(yyyyMMdd)

**local_file 模式**:本地 parquet/csv 列名非 `user_no`/`label`/`pday` 时,必须显式传 `--id-cols` / `--label-col` / `--dt-col`,否则 `run_sample_analysis_task_spec.py` 校验失败。

**样本量建议**:正样本 ≥ 500 基本可用、≥ 10,000 稳定;总样本 ≥ 50,000;正样本率 ≥ 1%

**Train/Test/OOT 切分**:请提供取数窗口 + 三档 pday 起止日期,或样本起止日期 + 三档比例。按时间顺序切分。
- 示例:取数窗口 20260322~20260522 / Train 20260322~20260427 / Test 20260429~20260510 / OOT 20260512~20260522

要点:已在用户原始表达里给出回答的项直接提取;用户回复后仍模糊的项仅简短追问一次;大部分维度有合理默认值,用户说"不知道/没想好"就标注"待确认/待探查"。

3.3 各维度补充说明(仅在用户回复模糊时参考)

  • WHO:不追问人群规模、是否分群建模、是否已有分层体系
  • WHAT:默认窗口 7 天。仅确认预测窗口和行为定义,不追问正样本精确定义、正样本率预估
  • HOW GOOD:无目标则标"待业务方确认",无基线则标"待数据探查"
  • CONSTRAINTS:无回复默认"无"
  • SAMPLE:spark 模式样本表默认列名 user_no/label/pday,可由 --id-cols/--label-col/--dt-col 覆盖;local_file 模式要求用户提供列名映射(--id-cols/--label-col/--dt-col)。数据拉取在本 skill 的样本分析阶段执行

3.4 信息不足时的处理

  1. 能推断的 → 给默认假设,标注"假设",请业务方确认
  2. 需要数据回答的 → 标注"待数据探查"
  3. 业务方才能回答的 → 标注"待业务方确认"

3.5 需求确认

完成信息收集后,按如下格式将需求整理展示给用户,要求用户确认:

请确认如下信息:
需求名称: sample_name_xxx

| # | 维度 | 值 | 来源 | 状态 |
|---|------|------|------|------|
| 1 | 人群 | 优质户 | 用户提供 | 已确认 |
| 2 | 预测目标 | 7天内是否发起动支 | 用户提供 | 已确认 |
| 3 | 效果目标 | 当前无目标 | 用户提供 | 已确认 |
| 4 | 约束 | 无 | 用户提供 | 已确认 |
| 5 | 使用方式 | 离线T+1跑批打分 | 默认值 | 待确认 |
| 6 | 样本表 | tmp_db.aaaaa | 用户提供 | 已确认 |

取数时间窗口:
- Train: 20260322 ~ 20260427
- Test:  20260429 ~ 20260510
- OOT:   20260512 ~ 20260522

全自动驾驶模式下不展示取数时间窗口。

3.6 需求确认后的样本分析

需求确认完成(成熟度 A 或 B)后,自动执行样本拉取和分析。若为 C 级则暂停,不进入此阶段。

强制前置:辅助驾驶模式下,进入样本分析前必须与用户显式确认 Train/Test/OOT 三档 pday 区间(不得默认比例、不得自动按比例切分;用户只给比例时追问具体日期)。全自动驾驶模式下默认 6:2:2 按时间顺序切分,无需用户确认。切分区间写入 model.split 后由 config_io.validate_split_ranges 强制校验。

样本拉取(spark / local_file 两模式)与样本分析脚本的 bash 调用、脚本行为差异、产出文件清单详见 references/sample-fetching-scripts.md。本节仅列调用入口与用户确认环节。

3.6.1 用户确认

脚本打印的汇总表包含:总样本量、正样本率、pday 范围、稳定性判定、三档切分的样本量/正样本率/pday 范围。LLM 直接复述该汇总给用户,请求确认。

必须用户确认后才能进入 classification-model-recommend(local_file 模式下跳过 recommend,直接进入 feature-matching)。

调整支持:

  • 用户可要求调整切分区间 → 修改区间后重跑脚本
  • 用户可要求调整比例 → 让用户给出具体日期,重跑脚本

4. 输出产物

4.1 目录结构

runs/{timestamp}-{model_name}/
├── task-spec/
│   ├── task-spec.md                          # 4 段式需求规格文档
│   ├── _manifest.json                        # 核心信息结构化提取
│   ├── sample_config.{model_name}.yaml       # fetch_sample_task_spec.py 落的配置
│   └── .done                                 # 完成标志
└── data-profile/
    ├── report.md / report.xlsx               # 样本分析报告
    ├── _manifest.json                        # 样本分析关键信息清单
    ├── _split_manifest.json                  # 切分清单
    ├── {model_name}_sample_{YYYYMMDD}.parquet  # 全量样本
    └── train.parquet / test.parquet / oot.parquet

4.2 task-spec.md(4 段式需求规格文档)

4 段式模板(建模目标 / 核心参数 / 样本数据 / 待处理项 + 下一步)详见 references/task-spec-template.md。模板含沟通时间、需求成熟度、模型简称、核心参数表、样本分析结果表、Train/Test/OOT 切分表、待处理项优先级表。

4.3 _manifest.json(核心信息结构化提取)

json
{
  "model_name": "{model_name}",
  "timestamp": "{YYYYMMDD-HHMMSS}",
  "maturity": "A | B | C",
  "driving_mode": "auto | manual",
  "business_scenario": "{增长/促活/获客/推荐}",
  "target_population": "{圈选条件}",
  "prediction_target": "{未来N天是否发生X行为}",
  "target_variable": "label",
  "performance_window": "{N天}",
  "estimated_positive_rate": "{X% or null}",
  "effect_target": "{P0指标 + 基线 or null}",
  "reach_method": "离线T+1跑批打分",
  "constraints": ["{约束1}", "{约束2}"],
  "source_table": "{table_name}",
  "assumptions": {
    "{维度}": { "value": "{假设值}", "status": "待确认 | 待数据探查" }
  },
  "pending": {
    "p0": ["{P0 阻塞项}"],
    "p1": ["{P1 非阻塞项}"]
  },
  "sample_summary": {
    "total_samples": null,
    "positive_rate": null,
    "pday_range": null,
    "stability_judgment": null,
    "sample_sufficiency": null
  },
  "split": {
    "method": "time-based",
    "ratio": "6:2:2",
    "train": { "samples": null, "positive_rate": null, "pday_range": null },
    "eval": { "samples": null, "positive_rate": null, "pday_range": null },
    "oot": { "samples": null, "positive_rate": null, "pday_range": null }
  }
}

driving_mode 字段:"auto" = 全自动驾驶(下游 feature-matching / development 跳过交互约定用默认值);"manual" = 辅助驾驶(默认)。缺失时视为 "manual"。

4.4 .done 文件

需求确认 + 样本分析均完成后生成,路径:runs/{timestamp}-{model_name}/task-spec/.done。内容:执行时间戳 + 完成状态。

5. 与其他 skill 关联

  • classification-model-orchestration — 上游,总编排器,调用本 skill 作为需求确认 + 样本分析环节
  • feature-matching — 下游,本 skill 完成样本分析后,由编排器第 4 步调用其拉取训练用特征样本(spark 模式走 spark-submit 拉宽表;local_file 模式复用本地 parquet + 推导特征列表,不做宽表拉取)
  • classification-model-recommend — 下游,历史模型检索推荐(local_file 模式跳过)
  • feature-analysis — 下游,特征质量分析(由 development Stage 0 调度)
  • classification-model-development — 下游,接收本文档输出建模方案

6. 执行约束

  1. 不涉及真实用户敏感数据
  2. 每个任务只执行一次,多次执行则替换上一次输出
  3. 全自动驾驶模式(driving_mode=auto):行为调整(数据模式、询问策略、切分默认、CLI 透传)详见 ../classification-model-orchestration/references/driving-mode.md 第 6.1 节

7. 异常处理

非二分类拒绝模板见 3.1 节,切分约束见 3.2 节。本节仅列处置动作。

7.1 需求成熟度 C 级

判定示例:"我想提高转化率" → 追问哪个环节/哪个用户群都不知道 → C 级。

处置:暂停流程,不创建任务目录,不进入样本分析。建议先做转化漏斗分析定位问题环节,再回来讨论建模。全自动驾驶模式下不出现 C 级。

7.2 样本量不足

对照 3.2 节"样本量建议"阈值,不达标时:

  • 正样本 < 500 → 标注"样本不足"
  • 总样本 < 50,000 → 标注"样本基本可用"
  • 正样本率 < 1% → 提醒用户可能影响模型效果

7.3 标签不稳定

正样本率波动幅度过大时,在报告中标注"显著波动",提醒用户切分区间可能需要调整,由用户决定是否修改区间重跑脚本。

7.4 结束汇报

需求文档 + 样本分析 + 切分全部完成时,汇报以下 7 项:

  1. task-spec.md 已生成,需求成熟度:{A/B/C}
  2. _manifest.json 已生成
  3. 建议的模型简称:{model_name}
  4. 源表:{table_name}
  5. 样本分析完成:全量样本量、正样本率、pday 范围、标签稳定性判定
  6. Train/Test/OOT 切分完成:{train_n}/{test_n}/{oot_n},已请用户确认
  7. 文件落盘清单:task-spec/task-spec.md + task-spec/_manifest.json + data-profile/report.md + data-profile/report.xlsx + data-profile/_manifest.json

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Classification Model Task Spec AI skill do?

业务建模需求挖掘 + 样本分析专家。首先判定问题类型(非二分类直接拒绝),用最少的问题将模糊业务诉求转化为可执行的建模目标,拉取样本验证标签质量并按时间顺序切分 Train/Test/OOT。输出 4 段式 task-spec.md + data-profile 报告。支持全自动驾驶模式(默认值填充,最少交互)。仅支持二分类场景。

Why use Classification Model Task Spec on TypingMind?

Because you install it once and use it with any model. Classification Model Task Spec is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Classification Model Task Spec in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/QFIN-tech/model-evo/tree/main/model-skills/classification-model-task-spec. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Classification Model Task Spec?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Classification Model Task Spec?

As many as you like. As long as a model supports skills, you can use Classification Model Task Spec with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Classification Model Task Spec AI skill free?

Yes. It is published on GitHub by QFIN-tech under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇