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

alpha158 & alpha360 support custom label

This commit is contained in:
Dong Zhou
2020-11-26 22:20:59 +08:00
parent 38cfb22cba
commit 07c1ca69a7

View File

@@ -126,6 +126,7 @@ class ALPHA360(DataHandlerLP):
learn_processors=_DEFAULT_LEARN_PROCESSORS, learn_processors=_DEFAULT_LEARN_PROCESSORS,
fit_start_time=None, fit_start_time=None,
fit_end_time=None, fit_end_time=None,
**kwargs,
): ):
infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time) infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time)
learn_processors = check_transform_proc(learn_processors, fit_start_time, fit_end_time) learn_processors = check_transform_proc(learn_processors, fit_start_time, fit_end_time)
@@ -135,7 +136,7 @@ class ALPHA360(DataHandlerLP):
"kwargs": { "kwargs": {
"config": { "config": {
"feature": self.get_feature_config(), "feature": self.get_feature_config(),
"label": self.get_label_config(), "label": kwargs.get("label", self.get_label_config()),
}, },
}, },
} }
@@ -206,6 +207,7 @@ class Alpha158(DataHandlerLP):
learn_processors=_DEFAULT_LEARN_PROCESSORS, learn_processors=_DEFAULT_LEARN_PROCESSORS,
fit_start_time=None, fit_start_time=None,
fit_end_time=None, fit_end_time=None,
**kwargs,
): ):
infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time) infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time)
learn_processors = check_transform_proc(learn_processors, fit_start_time, fit_end_time) learn_processors = check_transform_proc(learn_processors, fit_start_time, fit_end_time)
@@ -213,7 +215,7 @@ class Alpha158(DataHandlerLP):
data_loader = { data_loader = {
"class": "QlibDataLoader", "class": "QlibDataLoader",
"kwargs": { "kwargs": {
"config": {"feature": self.get_feature_config(), "label": self.get_label_config()}, "config": {"feature": self.get_feature_config(), "label": kwargs.get("label", self.get_label_config())},
}, },
} }
super().__init__( super().__init__(