Uplift Model T Learner Modeling 标志

Uplift Model T Learner Modeling

组织
QFIN-tech
uplift-model-t-learner-modeling

已有 confirmed task_config_path、modeling_sample_spec_path 和 feature_plan_path 后,用于训练 baseline T-Learner 模型并输出模型元数据、评估指标、打分表、uplift 分箱、分 component 特征重要性和报告。不要用于特征诊断、调参、模型比较或最终报告生成。

概览

发布者QFIN-tech
代码仓库model-evo
技能名称uplift-model-t-learner-modeling
星标数
52
复刻数
17
附带文件
3
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 3 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 QFIN-tech 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Uplift Model T Learner Modeling AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/QFIN-tech/model-evo/tree/main/model-skills/uplift-model-t-learner-modeling
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

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/uplift-model-t-learner-modeling .claude/skills/uplift-model-t-learner-modeling
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Uplift Model T Learner Modeling,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Uplift Model T Learner Modeling。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Uplift Model T Learner Modeling 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

T-Learner 基线建模

1. 输入依赖

本 skill 只负责 baseline T-Learner 训练和评估:

  • 读取已确认的 task_config_path、modeling_sample_spec_path 和 feature_plan_path。
  • 只使用 feature_plan_path 中已确认的业务特征训练模型。
  • treatment column 只用于拆分 treatment/control arm,不进入模型特征。
  • 在完整 train split 的 selected_features 上 fit 一套共享 encoder,两个子模型共用同一 encoded feature space。
  • binary outcome 使用两个 LGBMClassifier,continuous outcome 使用两个 LGBMRegressor。
  • 输出模型候选、模型元数据、评估指标、打分表、uplift 分箱、分 component 特征重要性和报告。

已有 confirmed task_config_path、modeling_sample_spec_path 和 feature_plan_path 后使用。

2. 执行入口

统一 CLI:

bash
python <skill-dir>/scripts/run.py --input - --output-dir <output_dir>

Windows 环境可按需将路径分隔符改为反斜杠。

--output-dir 必须是已存在的 run_dir;runner 不创建 run_dir,不扫描 latest/current。train 必须显式提供 experiment_id,格式为 exp-001-name 这类 ^exp-[0-9]{3}-[A-Za-z0-9][A-Za-z0-9_-]{0,63}$。目标 experiment 已存在时返回 needs_input / EXPERIMENT_ALREADY_EXISTS,不覆盖、不恢复。

请求 JSON 必须通过 stdin 传入:

json
{"action": "train", "payload": {"experiment_id": "exp-001-t_learner", "task_config_path": "...", "modeling_sample_spec_path": "...", "feature_plan_path": "..."}}

runner stdout 是 JSON object。调用方只读取 stdout 或 result JSON 中的 outputs.* 字段,例如 outputs.modeling_result_path、outputs.model_candidate_path、outputs.report_path。

只接受显式 *_path / *_paths 字段。收到旧的 *_ref / *_refs 输入时,runner 返回 needs_input,并在 issues 与 next_steps 中给出对应替代字段。

3. Actions 与参数说明

train

  • 输入:experiment_id、task_config_path、modeling_sample_spec_path、feature_plan_path。
  • 可选输入:parameter_mode、parameter_overrides。
  • 输出:
    • experiment_id
    • experiment_dir
    • modeling_result_path
    • model_candidate_path
    • model_metadata_path
    • evaluation_metrics_path
    • score_frame_path
    • uplift_bins_path
    • feature_importance_path
    • model_artifact_path
    • report_path
    • learner
    • modeling_metrics
    • split_evaluations

parameter_mode 支持:

  • recommended_defaults
  • user_overrides

parameter_overrides 只允许 LightGBM 训练参数,例如 n_estimators、learning_rate、num_leaves、max_depth、min_child_samples、random_state、n_jobs。

4. 输出产物

典型输出目录:

text
{run_dir}/new-models/{experiment_id}/
  inputs/0001_train.request.json
  results/0001_train.result.json
  artifacts/
    t_learner_model.v1.joblib
    t_learner_treatment_model.v1.txt
    t_learner_control_model.v1.txt
    model_candidate.v1.json
    model_metadata.v1.json
    evaluation_metrics.v1.json
    score_frame.v1.csv
    uplift_bins.v1.csv
    feature_importance.v1.csv
  _experiment_manifest.json
  _experiment_log.jsonl
  report.md

所有 stdout、result、manifest 和 log 中的持久化 path 都是 run_dir 相对路径。candidate_id 使用 experiment_id。下游比较优先通过 experiment_ids 进入 uplift-model-result-comparison 的 draft_comparison_plan。

score_frame.v1.csv 使用 treatment_prediction、control_prediction 和 uplift_score 表达两个潜在 outcome 预测差值。

feature_importance.v1.csv 是单文件,包含 component 字段;component 取值为 treatment_outcome 或 control_outcome。

outputs.split_evaluations 使用和 uplift-model-tuning winner 一致的结构,按 split 暴露 population_fingerprint、metric_name、metric_value、metric_method、metric_version、auuc_version 和 support。auuc_version 固定标记 {"package": "scikit-uplift", "version": "0.5.1"}。

5. 与其他 skill 的关联

方向Skill关系
上游uplift-model-feature-quality-analysis提供 confirmed feature_plan_path
上游uplift-model-sample-preparation提供 confirmed modeling_sample_spec_path
下游uplift-model-tuning消费 successful T-Learner modeling_result_path 生成调参 study
下游uplift-model-result-comparison消费 experiment_ids 或 modeling_result_path 参与模型比较

6. 执行约束

本 skill 不选择特征,不调参,不比较多个模型,不生成最终业务报告。

样本支持与风险

  • train split 缺 treatment 或 control arm 时返回 needs_input,issues[].code = "INSUFFICIENT_TRAIN_ARM_SUPPORT"。
  • binary outcome 下,train split 任一 arm 只有单一 outcome class 时返回 needs_input,issues[].code = "SINGLE_CLASS_TRAIN_ARM"。
  • evaluation split 缺 treatment 或 control arm 时训练仍可成功,但该 split 的 metric_value 为 null,并记录 issues[].code = "INSUFFICIENT_EVALUATION_ARM_SUPPORT"。
  • T-Learner 依赖 treatment/control 两个 arm 的可比性;如果上游样本选择或 treatment assignment 存在偏差,uplift 排序应保守解读。

模型文件安全

t_learner_model.v1.joblib 只能从可信来源加载。不要加载来源不明或被外部修改过的 joblib 模型文件。

7. 异常处理

7.1 缺依赖处理

本 skill 需要 pandas、numpy、joblib、lightgbm 和 scikit-uplift==0.5.1。runner 不安装依赖。缺包时返回结构化失败,并在 issue/next_steps 中提示阅读本 skill 的缺依赖处理说明,不返回 skill 安装目录文件路径。

AUUC 由 sklift.metrics.uplift_auc_score 和 sklift.metrics.uplift_curve 计算。

7.2 字段兼容与 experiment 异常

只接受显式 *_path / *_paths 字段。收到旧的 *_ref / *_refs 输入时,runner 返回 needs_input,并在 issues 与 next_steps 中给出对应替代字段。

目标 experiment 已存在时返回 needs_input / EXPERIMENT_ALREADY_EXISTS,不覆盖、不恢复。

8. 面向用户回复

普通用户回复默认使用中文。先给模型训练是否完成、测试集评估质量、主要风险和下一步。不要把 raw JSON、内部目录结构、长路径清单或实现术语作为主回复内容。

baseline 建模成功后,默认提示“下一步可进行模型调参”。如果当前 run_dir 下已有多个 baseline 模型,则提示“下一步可对当前模型调参,或先进行多模型比较以选择 baseline winner;若选择跳过调参,可直接进入比较”。不要仅因为已有多个 baseline 候选就只推荐多模型比较。

除非用户明确要求查看 JSON、调试、获取产物路径或手动接力下游流程,否则不要在用户回复中展示工程中的 .json 文件路径;modeling_result_path、model_candidate_path 等 JSON 路径只作为内部/下游输入传递。人类可读报告可以按需给出。

确需精确交接时,可在“技术详情”里保留 modeling_result_path、model_candidate_path、report_path 等字段名,并说明用途。

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Uplift Model T Learner Modeling AI 技能有什么作用?

已有 confirmed task_config_path、modeling_sample_spec_path 和 feature_plan_path 后,用于训练 baseline T-Learner 模型并输出模型元数据、评估指标、打分表、uplift 分箱、分 component 特征重要性和报告。不要用于特征诊断、调参、模型比较或最终报告生成。

为什么在 TypingMind 中使用 Uplift Model T Learner Modeling?

因为您只需安装一次,就能搭配任何模型使用。Uplift Model T Learner Modeling 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Uplift Model T Learner Modeling?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/QFIN-tech/model-evo/tree/main/model-skills/uplift-model-t-learner-modeling。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Uplift Model T Learner Modeling?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Uplift Model T Learner Modeling 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Uplift Model T Learner Modeling 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Uplift Model T Learner Modeling AI 技能免费吗?

是的。QFIN-tech 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇