From 3fcbaa33fa73cb8ce9f9b74efbfc5a91615e327a Mon Sep 17 00:00:00 2001 From: you-n-g Date: Tue, 14 Jun 2022 11:59:43 +0800 Subject: [PATCH] Fix hist_ref in update.py (#1096) * Fix hist_ref in update.py * Update setup.py --- qlib/workflow/online/update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qlib/workflow/online/update.py b/qlib/workflow/online/update.py index b5c22daed..0360d69b7 100644 --- a/qlib/workflow/online/update.py +++ b/qlib/workflow/online/update.py @@ -131,7 +131,7 @@ class DSBasedUpdater(RecordUpdater, metaclass=ABCMeta): .. note:: - the start_time is not included in the hist_ref + the start_time is not included in the `hist_ref`; So the `hist_ref` will be `step_len - 1` in most cases loader_cls : type the class to load the model and dataset @@ -184,9 +184,9 @@ class DSBasedUpdater(RecordUpdater, metaclass=ABCMeta): dataset: DatasetH = self.record.load_object("dataset") if unprepared_dataset is None else unprepared_dataset # Special treatment of historical dependencies if isinstance(dataset, TSDatasetH): - hist_ref = dataset.step_len + hist_ref = dataset.step_len - 1 else: - hist_ref = 0 + hist_ref = 0 # if only the lastest data is used, then only current data will be used and no historical data will be used else: hist_ref = self.hist_ref