Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By quantskillsGPL-3.0In 1 marketplace
Runs mRMR or Marginal-SAGE on local factor and label data to produce Top-K rankings.
Claude hands work to one, or you mention it with @.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
简体中文 | English
项目定位
skill-factor-ranking-sage面向量化多因子研究,对本地因子和标签数据运行回归 mRMR 或固定模型 Marginal-SAGE,输出可复现、可检查、可归档的 Top-K 因子排名。
本项目提供两种相互独立的因子排名方法:
两种方法均通过统一的 JSON 配置和命令行入口运行,并输出可检查、可复现的排名结果与运行记录。
主要功能包括:
1. 准备本地因子 CSV 和标签 CSV
2. 配置固定训练/验证窗口与隔离期
3. 选择 `mode=mrmr` 或 `mode=sage`
4. 先运行对应的示例配置
5. 运行研究配置 JSON
6. 检查运行清单、排名、标准误和提示信息
7. 在 Skill 外部锁定测试集
8. 比较全量、Top-K 和多个随机 Top-K 基线
skill-factor-ranking-sage/
├── SKILL.md
├── README.md / README.en.md
├── LICENSE
├── requirements.txt
├── agents/
│ ├── openai.yaml
│ ├── cursor-rule.mdc
│ └── portable-loader.md
├── examples/
│ ├── factor_selection_mrmr_smoke.json
│ ├── factor_selection_lgbm_smoke.json
│ ├── factor_selection_mlp_smoke.json
│ ├── toy_factors.csv
│ └── toy_labels.csv
├── references/
│ ├── source_boundary.md
│ ├── input_schema.md
│ ├── output_contract.md
│ ├── metric_definitions.md
│ ├── validation_notes.md
│ └── algorithm_sources.md
├── scripts/
│ ├── run_factor_selection.py
│ └── factor_selection_runtime/
└── tests/
至少提供两个本地 CSV:
feature_path:包含日期列、证券代码列和数值型因子列label_path:包含相同日期列、证券代码列和标签列约束:
(date, ticker) 样本(date, ticker) 必须唯一available_date 为可选字段;如未提供,运行结果会记录时点信息提示完整字段见 references/input_schema.md。
安装依赖:
python -m pip install -r requirements.txt
运行三组示例配置:
python scripts/run_factor_selection.py --input examples/factor_selection_mrmr_smoke.json
python scripts/run_factor_selection.py --input examples/factor_selection_lgbm_smoke.json
python scripts/run_factor_selection.py --input examples/factor_selection_mlp_smoke.json
运行自定义配置:
python scripts/run_factor_selection.py --input <input-json>
| 字段 | 类型 | 说明 |
|---|---|---|
run_name | string | 运行标识前缀 |
output_root | string | 输出根目录;每次生成 runs/<run_id> |
random_seed | integer | SAGE 模型、背景、验证抽样和排列随机种子 |
mode | string | mrmr 或 sage |
selection_count | integer | 输出 Top-K 数量 |
input.feature_path | string | 因子 CSV 路径 |
input.label_path | string | 标签 CSV 路径 |
data.date_col | string | 原始日期列名 |
data.ticker_col | string | 原始证券代码列名 |
data.label_col | string | 标签列名 |
data.feature_include | list[string] | 可选因子白名单 |
data.feature_exclude | list[string] | 可选因子排除列表 |
| 字段 | 说明 |
|---|---|
validation.train_start / train_end | 训练闭区间 |
validation.valid_start / valid_end | 验证闭区间 |
validation.embargo_days | 两窗口间至少需要存在的交易日期数量 |
mRMR 只使用训练行;SAGE 在训练行拟合模型并在验证行估计贡献。
| 字段 | 可选值 |
|---|---|
mrmr.relevance | 固定为 f |
mrmr.redundancy | 固定为 c |
mrmr.denominator | mean 或 max |
| 字段 | 说明 |
|---|---|
model.type | lgbm 或 mlp |
model.params | 直接传给对应模型适配器的参数 |
sage.loss | 当前固定为 mse |
sage.background_size | 经验边际填充背景行数 |
sage.evaluation_size | 验证候选池最大行数 |
sage.batch_size | 每轮采样数量 |
sage.n_permutations | 样本/排列预算;null 表示使用收敛检测 |
sage.detect_convergence | 是否允许满足阈值后提前停止 |
sage.convergence_threshold | 最大标准误与贡献范围之比的停止阈值 |
每次运行写入:
output_root/runs/<run_id>/
├── selected_factors.json
├── selection_report.md
├── resolved_config.json
├── input_manifest.json
└── run_manifest.json
mRMR 额外输出 mrmr_ranking.csv 和 mrmr_redundancy_matrix.csv。SAGE 额外输出 sage_values.csv 和 sage_metadata.json。
完整字段见 references/output_contract.md。
当前版本已通过以下自动化验证:
本项目采用 GNU General Public License v3.0,详见 LICENSE。
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
factor-ranking-sage@quantskills is listed by quantskills/registry — review the source before installing
npx claudepluginhub quantskills/registry --plugin factor-ranking-sagePlugins from other owners that cover similar ground