add more tests for datakitchen functionalities, add regression tests for freqai_interface train/backtest

This commit is contained in:
robcaulk
2022-07-20 12:56:46 +02:00
parent 9c051958a6
commit d43c146676
7 changed files with 415 additions and 119 deletions

View File

@@ -690,8 +690,6 @@ class FreqaiDataKitchen:
Append backtest prediction from current backtest period to all previous periods
"""
# ones = np.ones(len(predictions))
# target_mean, target_std = ones * self.data["target_mean"], ones * self.data["target_std"]
self.append_df = DataFrame()
for label in self.label_list:
self.append_df[label] = predictions[label]
@@ -707,13 +705,6 @@ class FreqaiDataKitchen:
else:
self.full_df = pd.concat([self.full_df, self.append_df], axis=0)
# self.full_predictions = np.append(self.full_predictions, predictions)
# self.full_do_predict = np.append(self.full_do_predict, do_predict)
# if self.freqai_config.get("feature_parameters", {}).get("DI_threshold", 0) > 0:
# self.full_DI_values = np.append(self.full_DI_values, self.DI_values)
# self.full_target_mean = np.append(self.full_target_mean, target_mean)
# self.full_target_std = np.append(self.full_target_std, target_std)
return
def fill_predictions(self, dataframe):
@@ -734,12 +725,6 @@ class FreqaiDataKitchen:
self.append_df = DataFrame()
self.full_df = DataFrame()
# self.full_predictions = np.append(filler, self.full_predictions)
# self.full_do_predict = np.append(filler, self.full_do_predict)
# if self.freqai_config.get("feature_parameters", {}).get("DI_threshold", 0) > 0:
# self.full_DI_values = np.append(filler, self.full_DI_values)
# self.full_target_mean = np.append(filler, self.full_target_mean)
# self.full_target_std = np.append(filler, self.full_target_std)
return

View File

@@ -170,11 +170,10 @@ class IFreqaiModel(ABC):
gc.collect()
dk.data = {} # clean the pair specific data between training window sliding
self.training_timerange = tr_train
# self.training_timerange_timerange = tr_train
dataframe_train = dk.slice_dataframe(tr_train, dataframe)
dataframe_backtest = dk.slice_dataframe(tr_backtest, dataframe)
trained_timestamp = tr_train # TimeRange.parse_timerange(tr_train)
trained_timestamp = tr_train
tr_train_startts_str = datetime.datetime.utcfromtimestamp(tr_train.startts).strftime(
"%Y-%m-%d %H:%M:%S"
)