fix(DataLoader): sort the data before merging (this corrupted the pipeline completely)

This commit is contained in:
Mark Aron Szulyovszky
2022-03-12 22:22:10 +01:00
parent c1d79ac8c2
commit 5b7bcbb5e9
4 changed files with 18 additions and 13 deletions
@@ -18,7 +18,9 @@ from .fractional_differentiation import (
)
__presets = dict(
debug_future_lookahead=[("debug_future", feature_debug_future_lookahead, [1])],
debug_future_lookahead=[
("debug_future", feature_debug_future_lookahead, [1, 5, 10])
],
single_mom=[("mom", feature_mom, [30])],
single_vol=[("vol", feature_vol, [30])],
mom=[("mom", feature_mom, [100, 300, 600, 900, 1800])],
+1 -1
View File
@@ -4,7 +4,7 @@ from feature_extractors.utils import get_close_low_high
def feature_debug_future_lookahead(df: pd.DataFrame, period: int) -> pd.Series:
return df["returns"].shift(-period)
return df["returns"].rolling(window=pd.api.indexers.FixedForwardWindowIndexer(window_size=period)).sum()
def feature_lag(df: pd.DataFrame, period: int) -> pd.Series: