Excuse me, when I execute dataset = init_instance_by_config(task["dataset"]) , I get an error:
module'qlib.data.dataset.processor' has no attribute'class' . It seems that there is a format problem when transcoding yaml, please help, thank you!
1、yaml
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
infer_processors:
- class: RobustZScoreNorm
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"]
2、code
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,
"infer_processors":{
"class": "RobustZScoreNorm",
"module_path": "qlib.data.dataset.processor",
"kwargs":{
"fields_group": ['$close'],
"clip_outlier": True
},
"class": "Fillna",
"module_path": "qlib.data.dataset.processor",
"kwargs":{
"fields_group": ['$close']
}
},
"learn_processors":{
"class": "DropnaLabel",
"module_path": "qlib.data.dataset.processor",
"class": "CSRankNorm",
"module_path": "qlib.data.dataset.processor",
"kwargs":{
"fields_group": ["Ref($close, -2) / Ref($close, -1) - 1"]
}
}
}
Excuse me, when I execute dataset = init_instance_by_config(task["dataset"]) , I get an error:
module'qlib.data.dataset.processor' has no attribute'class' . It seems that there is a format problem when transcoding yaml, please help, thank you!
1、yaml
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
infer_processors:
- class: RobustZScoreNorm
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"]
2、code
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,
"infer_processors":{
"class": "RobustZScoreNorm",
"module_path": "qlib.data.dataset.processor",
"kwargs":{
"fields_group": ['$close'],
"clip_outlier": True
},
"class": "Fillna",
"module_path": "qlib.data.dataset.processor",
"kwargs":{
"fields_group": ['$close']
}
},
"learn_processors":{
"class": "DropnaLabel",
"module_path": "qlib.data.dataset.processor",
"class": "CSRankNorm",
"module_path": "qlib.data.dataset.processor",
"kwargs":{
"fields_group": ["Ref($close, -2) / Ref($close, -1) - 1"]
}
}
}