Skip to content

Latest commit

 

History

History
92 lines (51 loc) · 5.71 KB

File metadata and controls

92 lines (51 loc) · 5.71 KB
graph LR
    Model_Base_Interface["Model Base Interface"]
    Model_Trainer["Model Trainer"]
    PyTorch_ALSTM_Model["PyTorch ALSTM Model"]
    GBDT_Model["GBDT Model"]
    Reinforcement_Learning_Trainer["Reinforcement Learning Trainer"]
    Signal_Strategy["Signal Strategy"]
    Strategy_Optimizer["Strategy Optimizer"]
    PyTorch_ALSTM_Model -- "implements" --> Model_Base_Interface
    GBDT_Model -- "implements" --> Model_Base_Interface
    Model_Trainer -- "orchestrates the training of" --> PyTorch_ALSTM_Model
    Model_Trainer -- "orchestrates the training of" --> GBDT_Model
    PyTorch_ALSTM_Model -- "generates predictions for" --> Signal_Strategy
    GBDT_Model -- "generates predictions for" --> Signal_Strategy
    Signal_Strategy -- "provides target positions/weights to" --> Strategy_Optimizer
Loading

CodeBoardingDemoContact

Details

The qlib model training and strategy generation subsystem is designed around a flexible architecture that separates model implementation from training orchestration and strategy application. The Model Base Interface establishes a common contract for all predictive models, ensuring that diverse models like PyTorch ALSTM Model and GBDT Model can be seamlessly integrated. The Model Trainer component is central to the training workflow, managing the lifecycle of these models. For specialized scenarios, the Reinforcement Learning Trainer handles the unique requirements of RL-based models. Once models generate predictions, the Signal Strategy component transforms these raw signals into actionable trading decisions, incorporating risk management. Finally, the Strategy Optimizer refines these decisions by applying portfolio optimization algorithms to determine optimal asset allocations, thus completing the pipeline from prediction to actionable trading strategy.

Model Base Interface

This component provides the fundamental abstract interface (predict method) that all predictive models within the platform must adhere to. It establishes a consistent contract for how models are expected to interact, ensuring extensibility and interchangeability of different model implementations.

Related Classes/Methods:

Model Trainer

Responsible for orchestrating the training and execution lifecycle of various machine learning models. It manages the overall training flow, including logging and task execution, by invoking the fit and predict methods of concrete model implementations.

Related Classes/Methods:

PyTorch ALSTM Model

A concrete deep learning model implementation (ALSTM) built with PyTorch, specifically tailored for generating predictions in quantitative finance. It implements the fit and predict methods defined by the Model Base Interface.

Related Classes/Methods:

GBDT Model

A concrete implementation of a Gradient Boosting Decision Tree (GBDT) model, offering an alternative machine learning approach for prediction. Like the ALSTM model, it implements the fit and predict methods from the Model Base Interface.

Related Classes/Methods:

Reinforcement Learning Trainer

A specialized trainer component dedicated to Reinforcement Learning (RL) models. It handles RL-specific training loops, manages interactions with the environment, and supports checkpointing for RL agents.

Related Classes/Methods:

Signal Strategy

This component translates raw model predictions (signals) into actionable trading decisions. It incorporates logic for risk management and stock filtering, consuming the predictions generated by trained models to formulate trading instructions.

Related Classes/Methods:

Strategy Optimizer

Provides various portfolio optimization algorithms. Its role is to refine trading strategies by calculating optimal asset weights based on target positions or weights provided by the Signal Strategy or other strategy components.

Related Classes/Methods: