Skip to content

Commit

Permalink
Adjust rolling api (microsoft#1594)
Browse files Browse the repository at this point in the history
* Intermediate version

* Fix yaml template & Successfully run rolling

* Be compatible with benchmark

* Get same results with previous linear model

* Black formatting

* Update black

* Update the placeholder mechanism

* Update CI

* Update CI

* Upgrade Black

* Fix CI and simplify code

* Fix CI

* Move the data processing caching mechanism into utils.

* Adjusting DDG-DA

* Organize import
  • Loading branch information
you-n-g authored and John Lyu committed Oct 11, 2023
1 parent 9a0291f commit d9936c4
Show file tree
Hide file tree
Showing 148 changed files with 1,034 additions and 1,027 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
deploy_with_manylinux:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_qlib_from_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
build:
if: ${{ false }} # FIXME: temporarily disable... Due to we are rushing a feature
timeout-minutes: 120

runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_qlib_from_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ jobs:
python -m pip install -e .[dev]
- name: Lint with Black
# Python 3.7 will use a black with low level. So we use python with higher version for black check
if: (matrix.python-version != '3.7')
run: |
pip install -U black # follow the latest version of black, previous Qlib dependency will downgrade black
black . -l 120 --check --diff
- name: Make html with sphinx
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.7.0
hooks:
- id: black
args: ["qlib", "-l 120"]
Expand All @@ -9,4 +9,4 @@ repos:
rev: 4.0.1
hooks:
- id: flake8
args: ["--ignore=E501,F541,E266,E402,W503,E731,E203"]
args: ["--ignore=E501,F541,E266,E402,W503,E731,E203"]
8 changes: 2 additions & 6 deletions docs/component/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ Below is a typical config file of ``qrun``.
kwargs:
topk: 50
n_drop: 5
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
backtest:
limit_threshold: 0.095
account: 100000000
Expand Down Expand Up @@ -281,9 +279,7 @@ The following script is the configuration of `backtest` and the `strategy` used
kwargs:
topk: 50
n_drop: 5
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
backtest:
limit_threshold: 0.095
account: 100000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
model: <MODEL>
dataset: <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/ADD/workflow_config_add_Alpha360.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/GATs/workflow_config_gats_Alpha158.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/GATs/workflow_config_gats_Alpha360.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/GRU/workflow_config_gru_Alpha158.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/GRU/workflow_config_gru_Alpha360.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
6 changes: 2 additions & 4 deletions examples/benchmarks/HIST/workflow_config_hist_Alpha360.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down Expand Up @@ -89,4 +87,4 @@ task:
- class: PortAnaRecord
module_path: qlib.workflow.record_temp
kwargs:
config: *port_analysis_config
config: *port_analysis_config
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
model: <MODEL>
dataset: <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/KRNN/workflow_config_krnn_Alpha360.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/LSTM/workflow_config_lstm_Alpha158.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
4 changes: 1 addition & 3 deletions examples/benchmarks/LSTM/workflow_config_lstm_Alpha360.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
1 change: 0 additions & 1 deletion examples/benchmarks/LightGBM/multi_freq_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(
)

def loader_config(self):

# Results for dataset: df: pd.DataFrame
# len(df.columns) == 6 + 6 * 16, len(df.index.get_level_values(level="datetime").unique()) == T
# df.columns: close0, close1, ..., close16, open0, ..., open16, ..., vwap16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
model: <MODEL>
dataset: <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
model: <MODEL>
dataset: <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ port_analysis_config: &port_analysis_config
kwargs:
topk: 50
n_drop: 5
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
backtest:
verbose: False
limit_threshold: 0.095
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ port_analysis_config: &port_analysis_config
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy
kwargs:
signal:
- <MODEL>
- <DATASET>
signal: <PRED>
topk: 50
n_drop: 5
backtest:
Expand Down
Loading

0 comments on commit d9936c4

Please sign in to comment.