Skip to content

Dev #1907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Dev #1907

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions DESIGN_DOC_UI_UX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### 2.1. 模型管理 (Model Management)

* **目的**: 创建、训练、管理和评估用于预测的机器学习模型。产出可供策略使用的"已训练模型"。
* **主要页面**:
* **`models.html` (模型列表页)**:
* **功能**: 展示所有已创建的模型及其状态和关键信息。提供新建模型入口。
* **表格列**:
* 名称
* 类型 (LightGBM, LSTM, ...)
* **训练周期** (例如: "2018-01-01 - 2022-12-31")
* **训练股票池** (例如: "CSI 300")
* **特征集** (例如: "Alpha158", 使用 `truncate` 显示,`title` 显示完整内容)
* **标签** (例如: "Ref($close,-2)/Ref($close,-1)-1", 使用 `truncate` 显示,`title` 显示完整内容)
* 状态 (草稿, 训练中..., 已训练, 失败)
* 创建时间
* 操作 (详情/编辑, 训练/重新训练, 删除, 取消训练等,根据状态显示不同按钮)
* **`create_model.html` (新建模型页)**:
* **功能**: 配置并启动一个新的模型训练任务。
* **卡片/区域**:
* **基本信息**: 模型名称 (必填), 模型描述。
* **训练配置 (Training Configuration - 新增)**:
* 训练开始日期 (必填, `date`)
* 训练结束日期 (必填, `date`)
* 训练股票池 (必填, `select`, 包含 CSI 300, CSI 500, 全市场A股等)
* 所用特征集 (必填, `text`, placeholder: "例如: Alpha158, VWAP")
* 标签/预测目标 (必填, `text`, placeholder: "例如: Ref($close,-2)/Ref($close,-1)-1")
* **模型配置 (Model Configuration)**:
* 模型类型 (必填, `select`, LightGBM, LSTM, ...)
* 模型参数 (根据类型动态显示常用参数输入,或提供高级 YAML/JSON 配置入口)
* **数据配置 (Data Configuration - 已精简)**: *此部分原始目的是映射 Qlib DataHandler 配置。为避免与"训练配置"重复,已移除标的范围(Universe)、特征、标签、训练期、验证期等字段。当前仅保留"数据源"和"数据频率"字段,用于定义基础数据访问信息。其最终必要性待后续审视。*
* **操作按钮**: 取消, 保存草稿, **保存并开始训练**。
* **`edit_model.html` (编辑/详情页)**:
* **功能**: 查看模型详细配置、训练状态、训练日志(未来)、评估结果(未来),并可编辑配置(对于草稿状态)或触发重新训练。
12 changes: 4 additions & 8 deletions examples/benchmarks/LSTM/workflow_config_lstm_Alpha158.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ data_handler_config: &data_handler_config
"ROC60", "RESI10", "VSTD5", "RSQR60", "CORR60", "WVMA60", "STD5",
"RSQR20", "CORD60", "CORD10", "CORR20", "KLOW"
]
- class: RobustZScoreNorm
- class: ZScoreNorm
kwargs:
fields_group: feature
clip_outlier: true
- class: Fillna
kwargs:
fields_group: feature
learn_processors:
- class: DropnaLabel
- class: CSRankNorm
kwargs:
fields_group: label
label: ["Ref($close, -2) / Ref($close, -1) - 1"]

port_analysis_config: &port_analysis_config
Expand Down Expand Up @@ -59,13 +55,13 @@ task:
hidden_size: 64
num_layers: 2
dropout: 0.0
n_epochs: 200
lr: 1e-3
n_epochs: 20
lr: 1e-5
early_stop: 10
batch_size: 800
metric: loss
loss: mse
n_jobs: 20
n_jobs: 8
GPU: 0
dataset:
class: TSDatasetH
Expand Down
23 changes: 23 additions & 0 deletions my_work/cursor_rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Cursor AI Assistant Rules & Context

## Project Goal
Learn the Qlib framework for quantitative trading by studying its source code.

## Qlib Source Location
The main Qlib source code is located at the workspace root: `/Users/chengzheng/workspace/trade/qlib`

## User Workspace
My personal learning scripts and experiments related to Qlib will be created and stored within the `/Users/chengzheng/workspace/trade/qlib/my_work/` directory. Please place any new scripts or generated files here unless otherwise specified.

## Learning Objectives
- Master the application of all algorithms within Qlib for quantitative trading, including strategy design and backtesting.
- Select and implement specific AI algorithms (learned through Qlib) to build custom trading strategies.
- Gain knowledge in Deep Learning (DL) and Reinforcement Learning (RL) concepts, particularly their application in quantitative finance, potentially using Qlib examples.
- Understand the overall architecture and design principles of the Qlib framework, referencing official documentation (e.g., [Qlib Quick Start](https://www.wuzao.com/document/qlib/introduction/quick.html)) and source code, to enable effective modular usage and customization.

## Interaction Style
- Assume I have access to the Qlib source code in the specified location.
- When discussing code, refer to file paths relative to the Qlib root (`/Users/chengzheng/workspace/trade/qlib`).
- When creating new code or examples for me, place them in the `my_work/` directory.
- Follow the RIPER-5 protocol for structured interaction.
- Prioritize Chinese for general conversation, while adhering to the protocol's format requirements for specific elements (e.g., mode declarations, checklists).
Loading