可解释AI/模型归因分析助手

SkillAI & models

Explainable AI / model attribution analysis for A-shares. Triggered when the user says "可解释AI", "XAI", "SHAP", "模型解释", "模型归因", "explainable", or "为什么模型这样预测". Fetches data via cn-stock-data and runs explainability analysis on quantitative models. Supports two output styles: formal and brief.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the 可解释AI/模型归因分析助手 skill

What this skill tells your AI

The instructions your AI receives, as published by aifinlab/finclaw in skills/a-share-explainable-ai/SKILL.md and read by ahel’s review.

数据获取

通过 cn-stock-data skill 获取数据:

  • 模型预测: ML模型的预测结果
  • 特征数据: 输入特征矩阵
  • K线数据: 用于验证解释合理性

分析工作流

Step 1: 全局解释

  • 特征重要性:Gain/Permutation/SHAP全局重要性
  • 部分依赖图(PDP):特征与预测的边际关系
  • 特征交互:SHAP交互值识别重要特征对
  • 全局代理模型:用简单模型近似复杂模型

Step 2: 局部解释

  • SHAP值:每个特征对单个预测的贡献
  • LIME:局部线性近似解释单个预测
  • 反事实解释:改变哪个特征可以改变预测
  • 锚点解释:找到决定预测的充分条件

Step 3: 模型诊断

  • 预测偏差分析:模型在哪些子群上表现差
  • 特征泄露检测:是否存在未来信息泄露
  • 概念漂移:特征-标签关系是否随时间变化
  • 公平性检查:模型是否对某些行业/市值有偏

Step 4: 解释驱动优化

  • 基于SHAP的特征选择:去除负贡献特征
  • 基于PDP的特征工程:发现非线性关系
  • 基于解释的模型调试:修正不合理的预测逻辑
  • 投资者沟通:用可解释结果说服投资决策

Step 5: 输出报告

输出格式

formal 风格(研报级)

# 可解释AI分析报告

## 一、全局解释
| 特征 | 重要性 | 方向 |
|------|--------|------|

## 二、局部解释
[个股SHAP瀑布图]

## 三、模型诊断
[偏差分析、漂移检测]

## 四、优化建议
[基于解释的改进方向]

brief 风格(快速分析)

## XAI速览
- Top3特征:换手率/20日动量/ROE
- 个股解释:XX被选中因为动量强+质量高
- 模型无明显偏差
- 建议:去除2个负贡献特征

参考 references/explainable-ai-guide.md 获取详细方法论与 A股实证研究。

使用示例

示例 1: 基本使用

# 调用 skill
result = run_skill({
    "param1": "value1",
    "param2": "value2"
})

示例 2: 命令行使用

python scripts/run_skill.py --input data.json

Signals

GitHub stars
241
Forks
38
Last commit
May 2026
Advanced
Catalog kind
skill
Gateway key
a-share-explainable-ai
Source
github.com/aifinlab/finclaw