Solution to the Exercise 7: Model Deployment

This workflow performs out-of sample forecasting of hourly energy consumption. It accesses a pretrained machine learning model that predicts the irregular component of energy consumption using lagged values as predictors. The out-of-sample forecasts are generated in a loop so that forecasted values are used for predicting values further ahead in time. Finally, seasonality and trend are restored to the time series, and the forecasting accuracy is shown by comparing the actual and forecasted values via scoring metrics and a line plot.

This is a companion discussion topic for the original entry at