mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
feat: ensure full backwards compatibility
This commit is contained in:
parent
75ec19062c
commit
72101f059d
|
@ -962,8 +962,7 @@ class FreqaiDataKitchen:
|
|||
" This can be achieved by following the migration guide at "
|
||||
f"{ft}/strategy_migration/#freqai-new-data-pipeline "
|
||||
"We added a basic pipeline for you, but this will be removed "
|
||||
"in a future version.\n"
|
||||
"This version does not include any outlier configurations")
|
||||
"in a future version.")
|
||||
|
||||
return data_dictionary
|
||||
|
||||
|
@ -977,11 +976,8 @@ class FreqaiDataKitchen:
|
|||
" This can be achieved by following the migration guide at "
|
||||
f"{ft}/strategy_migration/#freqai-new-data-pipeline "
|
||||
"We added a basic pipeline for you, but this will be removed "
|
||||
"in a future version.\n"
|
||||
"This version does not include any outlier configurations")
|
||||
"in a future version.")
|
||||
|
||||
pred_df, _, _ = self.label_pipeline.inverse_transform(df)
|
||||
self.DI_values = np.zeros(len(pred_df.index))
|
||||
self.do_predict = np.ones(len(pred_df.index))
|
||||
|
||||
return pred_df
|
||||
|
|
|
@ -979,6 +979,23 @@ class IFreqaiModel(ABC):
|
|||
" This can be achieved by following the migration guide at "
|
||||
f"{DOCS_LINK}/strategy_migration/#freqai-new-data-pipeline")
|
||||
dk.feature_pipeline = self.define_data_pipeline(threads=dk.thread_count)
|
||||
dd = dk.data_dictionary
|
||||
(dd["train_features"],
|
||||
dd["train_labels"],
|
||||
dd["train_weights"]) = dk.feature_pipeline.fit_transform(dd["train_features"],
|
||||
dd["train_labels"],
|
||||
dd["train_weights"])
|
||||
|
||||
(dd["test_features"],
|
||||
dd["test_labels"],
|
||||
dd["test_weights"]) = dk.feature_pipeline.transform(dd["test_features"],
|
||||
dd["test_labels"],
|
||||
dd["test_weights"])
|
||||
|
||||
dk.label_pipeline = self.define_label_pipeline(threads=dk.thread_count)
|
||||
|
||||
dd["train_labels"], _, _ = dk.label_pipeline.fit_transform(dd["train_labels"])
|
||||
dd["test_labels"], _, _ = dk.label_pipeline.transform(dd["test_labels"])
|
||||
return
|
||||
|
||||
def data_cleaning_predict(self, dk: FreqaiDataKitchen, pair: str):
|
||||
|
@ -989,5 +1006,12 @@ class IFreqaiModel(ABC):
|
|||
" data pipeline. Please update your model to use the new data pipeline."
|
||||
" This can be achieved by following the migration guide at "
|
||||
f"{DOCS_LINK}/strategy_migration/#freqai-new-data-pipeline")
|
||||
dk.label_pipeline = self.define_data_pipeline(threads=dk.thread_count)
|
||||
dd = dk.data_dictionary
|
||||
dd["predict_features"], outliers, _ = dk.feature_pipeline.transform(
|
||||
dd["predict_features"], outlier_check=True)
|
||||
if self.freqai_info.get("DI_threshold", 0) > 0:
|
||||
dk.DI_values = dk.feature_pipeline["di"].di_values
|
||||
else:
|
||||
dk.DI_values = np.zeros(len(outliers.index))
|
||||
dk.do_predict = outliers.to_numpy()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user