feat(Models): added debug_future_lookahead, sped up LogisticRegression & DecisionTreeClassifier (#74)

* feat(Models): added `debug_future_lookahead`, sped up LogisticRegression & DecisionTreeClassifier

* feat(Training): added ability to train on expanding_window

* feat(Models): tuned some hyperparameters, added expanding_window to sweep config, fixed tests

* feat(Models): tune parameters of ensemble models

* fix(Config): use window size that works with ensembling
This commit is contained in:
Mark Aron Szulyovszky
2021-12-22 16:59:03 +01:00
committed by GitHub
parent 25b64f5a3d
commit 6ae8acf70e
11 changed files with 32 additions and 10 deletions
@@ -1,4 +1,6 @@
from feature_extractors.feature_extractors import feature_lag, feature_mom, feature_ROC, feature_RSI, feature_STOD, feature_STOK, feature_vol, feature_day_of_month, feature_day_of_week, feature_month
from feature_extractors.feature_extractors import feature_lag, feature_mom, feature_ROC, feature_RSI, feature_STOD, feature_STOK, feature_vol, feature_day_of_month, feature_day_of_week, feature_month, feature_debug_future_lookahead
debug_future_lookahead = [('debug_future', feature_debug_future_lookahead, [1])]
lags = [('lag', feature_lag, [1,2,3,4,5,6,7,8,9])]
+4
View File
@@ -11,7 +11,11 @@ def __get_close_low_high(df: pd.DataFrame) -> tuple[pd.Series, pd.Series, pd.Ser
## Feature extractors
def feature_debug_future_lookahead(df: pd.DataFrame, period: int, is_log_return: bool) -> pd.Series:
return df['returns'].shift(-period)
def feature_lag(df: pd.DataFrame, period: int, is_log_return: bool) -> pd.Series:
assert period > 0
return df['returns'].shift(period)
def feature_day_of_week(df: pd.DataFrame, period: int, is_log_return: bool) -> pd.DataFrame: