Skip to content

Instantly share code, notes, and snippets.

@bkaankuguoglu
Created January 15, 2022 15:05
Show Gist options
  • Save bkaankuguoglu/0b68cce1a83e54102cb983cd261a5e37 to your computer and use it in GitHub Desktop.
Save bkaankuguoglu/0b68cce1a83e54102cb983cd261a5e37 to your computer and use it in GitHub Desktop.
def format_forecasts(forecasts, index, scaler):
preds = np.concatenate(forecasts, axis=0).ravel()
df_forecast = pd.DataFrame(data={"prediction": preds}, index=index)
df_result = df_forecast.sort_index()
df_result = inverse_transform(scaler, df_result, [["prediction"]])
return df_result
df_forecast = format_forecasts(forecasts, index, scaler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment