Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking clarification on setting custom holiday prior scale #2555

Open
aidanhor-n opened this issue Feb 19, 2024 · 2 comments
Open

Seeking clarification on setting custom holiday prior scale #2555

aidanhor-n opened this issue Feb 19, 2024 · 2 comments

Comments

@aidanhor-n
Copy link

aidanhor-n commented Feb 19, 2024

*EDIT: The questions I have are specifically about this line in the docs. You can also include a column prior_scale to set the prior scale separately for each holiday, as described below.

prior_scale syntax
Assuming I have a holidays dataframe as shown in the docs with an additional holiday flag called 'christmas', is the following an appropriate way to set different prior_scales?

holidays['prior_scale'] = 0.1
holidays.loc[holidays['holiday'] == 'christmas', 'prior_scale'] = 10

intended effect
The snippet from my fitted forecast below shows a consistent underestimation of the holiday effect for christmas.
image
Assuming the above syntax is correct, I have tried increasing the prior_scale to increase the flexibility of the 'christmas' holiday fit in hopes it will approach the actual. However, I have tried some reasonable priors (0.5, 1, 10) as well as 1000 and noticed no difference in the final effect.

Any insight would be appreciated here. Thank you.

@imad24
Copy link
Contributor

imad24 commented Feb 21, 2024

holidays_prior_scale is a hyperparameter of the model that you set when you instantiate the Prophet model:

m = Prophet(holidays=holidays, holidays_prior_scale=0.05).fit(df)

More info here in the docs.

You don't need to set it in the dataframe. However, it will apply to all the "holidays regressors". To my knowledge, you cannot set it by type of holidays.

@aidanhor-n
Copy link
Author

holidays_prior_scale is a hyperparameter of the model that you set when you instantiate the Prophet model:

m = Prophet(holidays=holidays, holidays_prior_scale=0.05).fit(df)

More info here in the docs.

You don't need to set it in the dataframe. However, it will apply to all the "holidays regressors". To my knowledge, you cannot set it by type of holidays.

The docs do say "You can also include a column prior_scale to set the prior scale separately for each holiday, as described below" and "Prior scales can be set separately for individual holidays by including a column prior_scale in the holidays dataframe". There just doesn't seem to be any actual examples of this that I could find in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants