prophet icon indicating copy to clipboard operation
prophet copied to clipboard

Treat sunday and end of month as Holiday

Open nadyadtm opened this issue 2 years ago • 1 comments

If the transaction is closed on Sunday and there are a peak in every one day in a month (ex : every seventh day in a month), can I add those day as holidays? If no, what is the best practice?

nadyadtm avatar Oct 13 '23 04:10 nadyadtm

@nadyadtm, from your description this sounds more like the holidays library problem (which I have experience with as the library maintainer) rather than fbprophet one (no hands-on experience here).

After looking into the forecaster's business logic you can find out that it uses make_holidays_df from make_holidays.py. So the idea would be to change how this module composes the data frame by overriding make_holidays_df logic.

Perhaps, the best approach would involve creating your own class for a country holidays and changing the get_country_holidays_class logic to use that class instead of a default one provided by python-holidays.

Your own country holidays class would need to have your desired logic (treat every Sunday and every 7th day of month as a holiday) implemented.

This is how I'd tackle the problem provided that my understanding of the context is correct.

arkid15r avatar Oct 25 '23 16:10 arkid15r