Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hist_ref in update.py #1096

Merged
merged 4 commits into from
Jun 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions qlib/workflow/online/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __init__(

.. 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
Expand Down Expand Up @@ -184,9 +184,9 @@ def prepare_data(self, unprepared_dataset: Optional[DatasetH] = None) -> Dataset
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

Expand Down