From 0c9a9b0389b67329e99bc86439809f10ee9706e9 Mon Sep 17 00:00:00 2001 From: Alfredo Deza <317847+alfredodeza@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:01:02 -0400 Subject: [PATCH] update ARIMA README with fixes for HORIZON+1 --- 7-TimeSeries/2-ARIMA/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/7-TimeSeries/2-ARIMA/README.md b/7-TimeSeries/2-ARIMA/README.md index 3134d939..b94fed48 100644 --- a/7-TimeSeries/2-ARIMA/README.md +++ b/7-TimeSeries/2-ARIMA/README.md @@ -261,7 +261,7 @@ Walk-forward validation is the gold standard of time series model evaluation and for t in range(test_ts.shape[0]): model = SARIMAX(endog=history, order=order, seasonal_order=seasonal_order) model_fit = model.fit() - yhat = model_fit.forecast(steps = HORIZON) + yhat = model_fit.forecast(steps = HORIZON+1) predictions.append(yhat) obs = list(test_ts.iloc[t]) # move the training window @@ -287,8 +287,8 @@ Walk-forward validation is the gold standard of time series model evaluation and 1. Compare the predictions to the actual load: ```python - eval_df = pd.DataFrame(predictions, columns=['t+'+str(t) for t in range(1, HORIZON+1)]) - eval_df['timestamp'] = test.index[0:len(test.index)-HORIZON+1] + eval_df = pd.DataFrame(predictions, columns=['t+'+str(t) for t in range(1, HORIZON+2)]) + eval_df['timestamp'] = test.index[0:len(test.index)-HORIZON] eval_df = pd.melt(eval_df, id_vars='timestamp', value_name='prediction', var_name='h') eval_df['actual'] = np.array(np.transpose(test_ts)).ravel() eval_df[['prediction', 'actual']] = scaler.inverse_transform(eval_df[['prediction', 'actual']])