Creating custom holidays
The default holidays for the United States include both Thanksgiving and Christmas, as they are official holidays. However, it's quite plausible that Black Friday and Christmas Eve would also create ridership behavior that deviates from the expected trend. So, we naturally decide to include these in our forecast.
In this example, we will create a DataFrame of the default US holidays in a similar manner to how we created the DataFrame of the Illinois holidays previously, and then add our custom holidays to it. To create custom holidays, you simply need to create a DataFrame with two columns: holiday
and ds
. As done previously, it must include all occurrences of the holiday in the past (at least, as far back as your training data goes) and into the future that we intend to forecast.
In this example, we will start by creating the holidays
DataFrame populated with the default US holidays and use the same year_list
from the previous example:
holidays...