I am using the below codes for forecasting but i am not getting it right.
Steps performed
-
Stationery Check
-
Differencing
-
Decomposing the Time Series
-
Fitting the Data with Holt-Winters Exponential Smoothing
-
Forecasting with Holt-Winters Exponential Smoothing (Triple ES)
fitted_model = ExponentialSmoothing(df[‘df Index’], trend=’mul’, seasonal=’mul’, seasonal_periods=12).fit()
test_predictions = fitted_model.forecast(24)
combined_data = pd.concat([df[‘df Index’], test_predictions], axis=0)
plt.figure(figsize=(10, 6))
df[‘df Index’].plot(legend=True, label=’TRAIN’)
df[‘df Index’][-24:].plot(legend=True, label=’TEST’)
test_predictions.plot(legend=True, label=’PREDICTION’)
plt.title(‘Train, Test, and Predicted Test using Holt Winters’)
plt.xlabel(‘Date’)
plt.ylabel(‘df Index’)
plt.tight_layout()
plt.show()
I need to have prediction and test comparative but i need help to get it.
Plot
Roxy Roks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1