feat(HPO): added run_hpo script (#237)

* feat(HPO): added `run_hpo` script

* fix(Linter): ran

* feat(HPO): removed any reference to sweep (superseeded by optuna)

* fix(HPO): optimize for sharpe

* fix(Config): removed glassnode data, save trials from hpo

* feat(Labelling): added three-balanced method works again

* fix(BetSizing): set the correct class labels

* fix(HPO): powerset should return what's expected, added two new normalization methods

* fix(Linter): ran

* fix(DataLoader): sort the dataframe when fetching data

* fix(Config): only take z-score of other assets
This commit is contained in:
Mark Aron Szulyovszky
2022-03-15 14:43:16 +01:00
committed by GitHub
parent 345b48a67c
commit b5ddee8dce
30 changed files with 126 additions and 115 deletions
+6 -5
View File
@@ -7,7 +7,7 @@ from numba.typed import List
class CUSUMVolatilityEventFilter(EventFilter):
def __init__(self, vol_period: int, multiplier: float):
def __init__(self, multiplier: float, vol_period=100):
self.vol_period = vol_period
self.multiplier = multiplier
@@ -23,13 +23,14 @@ class CUSUMVolatilityEventFilter(EventFilter):
class CUSUMFixedEventFilter(EventFilter):
def __init__(self, threshold: float):
self.threshold = threshold
def __init__(self, threshold_multiplier: float):
self.threshold_multiplier = threshold_multiplier
def get_event_start_times(self, returns: ReturnSeries) -> pd.DatetimeIndex:
diffed_returns = returns.diff()
int_indicies = _process_fixed(
List(diffed_returns.to_list()), abs(returns.mean()) * self.threshold
int_indicies = _process(
List(diffed_returns.to_list()),
abs(returns.mean()) * self.threshold_multiplier,
)
return pd.DatetimeIndex([returns.index[i] for i in int_indicies])
+3
View File
@@ -4,5 +4,8 @@ import pandas as pd
class NoEventFilter(EventFilter):
def __init__(self, ignored_threshold_multiplier: float):
pass
def get_event_start_times(self, returns: ReturnSeries) -> pd.DatetimeIndex:
return returns.index