mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-21 23:08:09 +00:00
feat(Labeling): purge overlapping events, sort dataframe at loading time (#226)
* feat(Labeling): purge overlapping events, sort dataframe at loading time * fix(Linter): ran * refactor(Labeling): moved purge_overlapping_events one abstraction level higher * fix(Data): renamed class * fix(Data): corrected parameter name * fix(Config): parameters * fix(Data): fixed path * fix(Data): uncommented required code * feat(EventFilters): use vol based CUSUM * fix(Config): only retrain every 2000 samples * fix(Config): filter out even more events * fix(Inference): added remove_overlapping_events * refactor(Types): simplified type hierarchy
This commit is contained in:
+7
-3
@@ -45,7 +45,11 @@ def __inference(config: Config, pipeline_outcome: PipelineOutcome):
|
||||
|
||||
# 2. Filter for significant events when we want to trade, and label data
|
||||
events, X, y, forward_returns = label_data(
|
||||
config.event_filter, config.labeling, X, returns
|
||||
event_filter=config.event_filter,
|
||||
event_labeller=config.labeling,
|
||||
X=X,
|
||||
returns=returns,
|
||||
remove_overlapping_events=config.remove_overlapping_events,
|
||||
)
|
||||
|
||||
inference_from: pd.Timestamp = X.index[len(X.index) - 1]
|
||||
@@ -65,7 +69,7 @@ def __inference(config: Config, pipeline_outcome: PipelineOutcome):
|
||||
# 4. Run bet sizing on primary model's output
|
||||
bet_sizing_outcome = bet_sizing_with_meta_model(
|
||||
X=X,
|
||||
input_predictions=directional_training_outcome.training.predictions,
|
||||
input_predictions=directional_training_outcome.predictions,
|
||||
y=y,
|
||||
forward_returns=forward_returns,
|
||||
model=config.meta_model,
|
||||
@@ -73,7 +77,7 @@ def __inference(config: Config, pipeline_outcome: PipelineOutcome):
|
||||
config=config,
|
||||
model_suffix="meta",
|
||||
from_index=inference_from,
|
||||
transformations_over_time=pipeline_outcome.bet_sizing.meta_transformations,
|
||||
transformations_over_time=pipeline_outcome.bet_sizing.meta_training.transformations,
|
||||
preloaded_models=pipeline_outcome.bet_sizing.meta_training.model_over_time,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user