mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-02 02:21:18 +08:00
* Add docs for qlib.rl * Update docs for qlib.rl * Add homepage introduct to RL framework * Update index Link * Fix Icon * typo * Update catelog * Update docs for qlib.rl * Update docs for qlib.rl * Update figure * Update docs for qlib.rl * Update setup.py * FIx setup.py * Update docs and fix some typos * Fix the reference to RL docs * Update framework.svg * Update framework.svg * Update framework.svg * Update docs for qlibrl. * Update docs for qlibrl. * Update docs for Qlibrl. * Update docs for qlibrl. * Update docs for qlibrl. * Update docs for qlibrl. * Add new framework * Update jpg * Update framework.svg * Update framework.svg * Update Qlib framework and description * Update grammar * Update README.md * Update README.md * Update docs/component/rl.rst Co-authored-by: you-n-g <you-n-g@users.noreply.github.com> * Update docs/component/rl.rst Co-authored-by: you-n-g <you-n-g@users.noreply.github.com> * Update docs for qlib.rl * Change theme for docs. * Update docs for qlib.rl * Update docs for qlib.rl * Update docs for qlib.rl * Update docs for qlib.rl. * Update docs for qlib.rl * Update docs for qlib.rl * Update docs for qlib.rl Co-authored-by: Young <afe.young@gmail.com> Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
This folder contains a simple example of how to run Qlib RL. It contains:
|
|
|
|
```
|
|
.
|
|
├── experiment_config
|
|
│ ├── backtest # Backtest config
|
|
│ └── training # Training config
|
|
├── README.md # Readme (the current file)
|
|
└── scripts # Scripts for data pre-processing
|
|
```
|
|
|
|
## Data preparation
|
|
|
|
Use [AzCopy](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10) to download data:
|
|
|
|
```
|
|
azcopy copy https://qlibpublic.blob.core.windows.net/data/rl/qlib_rl_example_data ./ --recursive
|
|
mv qlib_rl_example_data data
|
|
```
|
|
|
|
The downloaded data will be placed at `./data`. The original data are in `data/csv`. To create all data needed by the case, run:
|
|
|
|
```
|
|
bash scripts/data_pipeline.sh
|
|
```
|
|
|
|
After the execution finishes, the `data/` directory should be like:
|
|
|
|
```
|
|
data
|
|
├── backtest_orders.csv
|
|
├── bin
|
|
├── csv
|
|
├── pickle
|
|
├── pickle_dataframe
|
|
└── training_order_split
|
|
```
|
|
|
|
## Run training
|
|
|
|
Run:
|
|
|
|
```
|
|
python -m qlib.rl.contrib.train_onpolicy.py --config_path ./experiment_config/training/config.yml
|
|
```
|
|
|
|
After training, checkpoints will be stored under `checkpoints/`.
|
|
|
|
## Run backtest
|
|
|
|
```
|
|
python -m qlib.rl.contrib.backtest.py --config_path ./experiment_config/backtest/config.yml
|
|
```
|
|
|
|
The backtest workflow will use the trained model in `checkpoints/`. The backtest summary can be found in `outputs/`.
|