mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-17 04:48:09 +00:00
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:
@@ -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])]
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user