1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 22:36:55 +08:00

Add TabNet config

This commit is contained in:
Jactus
2020-11-25 11:16:01 +08:00
parent 0e2c2fcd7f
commit 991c6195bd
9 changed files with 114 additions and 34 deletions

View File

@@ -37,7 +37,7 @@ task:
module_path: qlib.data.dataset
kwargs:
handler:
class: ALPHA360_Denoise
class: Alpha158
module_path: qlib.contrib.data.handler
kwargs: *data_handler_config
segments:

View File

@@ -44,7 +44,7 @@ task:
module_path: qlib.data.dataset
kwargs:
handler:
class: ALPHA360_Denoise
class: Alpha158
module_path: qlib.contrib.data.handler
kwargs: *data_handler_config
segments:

View File

@@ -0,0 +1,5 @@
pandas==1.1.2
numpy==1.17.4
scikit_learn==0.23.2
torch==1.7.0
pytorch-tabnet==2.0.1

View File

@@ -0,0 +1,66 @@
provider_uri: "~/.qlib/qlib_data/cn_data"
region: cn
market: &market csi300
benchmark: &benchmark SH000300
data_handler_config: &data_handler_config
start_time: 2008-01-01
end_time: 2020-08-01
fit_start_time: 2008-01-01
fit_end_time: 2014-12-31
instruments: *market
port_analysis_config: &port_analysis_config
strategy:
class: TopkDropoutStrategy
module_path: qlib.contrib.strategy.strategy
kwargs:
topk: 50
n_drop: 5
backtest:
verbose: False
limit_threshold: 0.095
account: 100000000
benchmark: *benchmark
deal_price: close
open_cost: 0.0005
close_cost: 0.0015
min_cost: 5
task:
model:
class: TabNetModel
module_path: qlib.contrib.model.tabnet
kwargs:
n_d: 8
n_a: 8
n_steps: 3
gamma: 1.3
n_independent: 2
n_shared: 2
seed: 0
momentum: 0.02
lambda_sparse: 1e-3
optimizer_params: {lr: 2e-3}
dataset:
class: DatasetH
module_path: qlib.data.dataset
kwargs:
handler:
class: Alpha158
module_path: qlib.contrib.data.handler
kwargs: *data_handler_config
segments:
train: [2008-01-01, 2014-12-31]
valid: [2015-01-01, 2016-12-31]
test: [2017-01-01, 2020-08-01]
record:
- class: SignalRecord
module_path: qlib.workflow.record_temp
kwargs: {}
- class: SigAnaRecord
module_path: qlib.workflow.record_temp
kwargs:
ana_long_short: False
ann_scaler: 252
- class: PortAnaRecord
module_path: qlib.workflow.record_temp
kwargs:
config: *port_analysis_config

View File

@@ -71,7 +71,7 @@ if __name__ == "__main__":
"seed": 0,
"momentum": 0.02,
"lambda_sparse": 1e-3,
"optimizer_params": {'lr':2e-3}
"optimizer_params": {"lr": 2e-3},
},
},
"dataset": {