-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 concat then filter #397
Conversation
kwargs['col_set'] = ['filter'] | ||
data_filter = super()._prepare_seg(slc=slc, **kwargs) | ||
if kwargs.get('data_key') == DataHandlerLP.DK_L: | ||
col_filter = data_filter['filter']['keep_train'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't hardcode them
if kwargs.get('data_key') == DataHandlerLP.DK_L: | ||
col_filter = data_filter['filter']['keep_train'] | ||
elif kwargs.get('data_key') == DataHandlerLP.DK_I: | ||
col_filter = data_filter['filter']['keep_test'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussion....
@@ -470,6 +489,7 @@ def _prepare_seg(self, slc: slice, **kwargs) -> TSDataSampler: | |||
|
|||
# TSDatasetH will retrieve more data for complete | |||
data = super()._prepare_seg(slice(pad_start, end), **kwargs) | |||
col_filter = _prepare_col_filter(slice(pad_start, end), **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if col_filter[idx2]: | ||
idx_map[idx] = (i, j) | ||
idx += 1 | ||
idx2 += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -279,8 +279,12 @@ def __init__(self, data: pd.DataFrame, start, end, step_len: int, fillna_type: s | |||
|
|||
# the data type will be changed | |||
# The index of usable data is between start_idx and end_idx | |||
self.start_idx, self.end_idx = self.data.index.slice_locs(start=pd.Timestamp(start), end=pd.Timestamp(end)) | |||
self.idx_df, self.idx_map = self.build_index(self.data) | |||
if col_filter is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notice padding
@@ -470,6 +489,7 @@ def _prepare_seg(self, slc: slice, **kwargs) -> TSDataSampler: | |||
|
|||
# TSDatasetH will retrieve more data for complete | |||
data = super()._prepare_seg(slice(pad_start, end), **kwargs) | |||
col_filter = _prepare_col_filter(slice(pad_start, end), **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closed due to the same feature merged in #290 |
Description
Motivation and Context
How Has This Been Tested?
pytest qlib/tests/test_all_pipeline.py
under upper directory ofqlib
.Screenshots of Test Results (if appropriate):
Types of changes