ensure convolutional window is prepended for frequi consistency

This commit is contained in:
robcaulk 2022-07-31 17:51:19 +02:00
parent d830105605
commit 4e68626bcb

View File

@ -238,6 +238,15 @@ class FreqaiDataDrawer:
mrv_df["do_predict"] = do_preds
# for keras type models, the conv_window needs to be prepended so
# viewing is correct in frequi
if self.freqai_info.get('keras', False):
n_lost_points = self.freqai_info.get('conv_width', 2)
zeros_df = DataFrame(np.zeros((n_lost_points, len(mrv_df.columns))),
columns=mrv_df.columns)
self.model_return_values[pair] = pd.concat(
[zeros_df, mrv_df], axis=0, ignore_index=True)
def append_model_predictions(self, pair: str, predictions: DataFrame,
do_preds: NDArray[np.int_],
dk: FreqaiDataKitchen, len_df: int) -> None: