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.

Feed holidays data into the model

Feed holidays data into the model - Python Tutorial

From the course: Python for Time Series Forecasting

Feed holidays data into the model

- [Instructor] In the parameters, we have the holidays that can be created before by importing from prophet, make holidays, the function, make_holidays_df. Now this one requires a year list that we can use based on the historical data, on the index. Access for the year, and then get the unique values. But maybe we want further into the future. So we can grab the minimum and maximum years, which is the first and last one. Save it into the variables start and end. And now to the end, we can add, let's say 10 more years and create a list whose range goes from start to end. We save this into a variable year list and pass it to the make holidays function on the year list. Now for the country, we can specify any of them. And in this case we use the US. Then we get the data frame with the historical holidays. We save it into a variable and pass it to the prophet class. Now we execute everything again. Calculate the numbers of the mathematical equation. You can see how they have changed. And…

Contents