From the course: Python for Time Series Forecasting

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Data preprocessing to forecast and visualize values

Data preprocessing to forecast and visualize values - Python Tutorial

From the course: Python for Time Series Forecasting

Data preprocessing to forecast and visualize values

- [Instructor] To close the loop, let's go with the forecast, because right now the model is only displayed on historical data. For this, we also need to use a function to make the future data frame, which requires the periods to forecast into the future, and the frequency. For the periods, we will specify a horizon of 48 days and a frequency of month at the end, the same one as we have in our data. Remember, from series, the index frequency. We execute. Here we also get a parameter to include history. That by default is true. If we set to false, we get fewer data points, just the 48 to forecast into the future. We save it into a variable, let's call it future. And now the function predicts with the future data frame. We save it into a variable, let's call it df_forecast, and use the function model.plot to visualize the historical data, which are the data points, and then forecast into the future. In this function, we better use the history. So we can change this to true and reflect a…

Contents