ML市场状态聚类/无监督分类助手

SkillDev tools

A-share ML market regime clustering / unsupervised classification. Triggered when the user says "市场聚类", "无监督分类", "状态聚类", "ML聚类", "K-means市场", "市场分类", or "聚类分析市场". Fetches data via cn-stock-data and uses unsupervised learning to identify market regimes. Supports two output styles: formal/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 ML市场状态聚类/无监督分类助手 skill

What this skill tells your AI

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

数据获取

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

  • K线数据: 指数日线+个股日线
  • 市场指标: 波动率/成交量/涨跌比
  • 资金流数据: 北向/融资/主力资金

分析工作流

Step 1: 市场特征提取

  • 收益率特征:均值/波动率/偏度/峰度
  • 成交量特征:量能水平/量比/换手率
  • 市场宽度:涨跌家数比/涨停跌停数
  • 资金特征:北向净流入/融资余额变化

Step 2: 聚类算法选择

  • K-Means:简单高效,需预设K值
  • GMM:高斯混合模型,软聚类概率输出
  • DBSCAN:密度聚类,自动发现簇数
  • 层次聚类:树状图可视化市场状态层次

Step 3: 状态识别与标注

  • 典型状态:牛市/熊市/震荡/转折
  • 状态转移概率矩阵:各状态间的转换概率
  • 当前状态判断:实时特征→最近邻状态
  • 状态持续时间分布:各状态平均持续天数

Step 4: 状态适配策略

  • 不同状态下的最优策略选择
  • 状态转换信号:提前识别状态切换
  • 仓位管理:按状态调整股票/现金比例
  • 因子轮动:不同状态下有效因子不同

Step 5: 输出报告

输出格式

formal 风格(研报级)

# ML市场状态聚类报告

## 一、聚类结果
| 状态 | 特征 | 占比 | 当前概率 |
|------|------|------|----------|

## 二、状态转移
[转移概率矩阵]

## 三、当前状态
[判断结果与置信度]

## 四、策略建议
[当前状态下的最优策略]

brief 风格(快速分析)

## 市场状态速览
- GMM识别4种状态
- 当前状态:震荡偏多(概率68%)
- 转向牛市概率 22%
- 建议:维持6成仓位,偏向动量因子

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

Signals

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