facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.38k stars 4.53k forks source link

AttributeError: 'Prophet' object has no attribute 'add_country_holidays' #787

Closed abhisranj closed 5 years ago

abhisranj commented 5 years ago

Trying to add in built country holidays as mentioned in the doc (https://facebook.github.io/prophet/docs/seasonality,_holiday_effects,_and_regressors.html#modeling-holidays-and-special-events)

Executing this code -->

optimal_model = Prophet(n_changepoints=25, changepoint_prior_scale=0.1, changepoint_range=0.7, seasonality_mode='multiplicative', weekly_seasonality=4)
optimal_model.add_country_holidays(country_name = 'IN')
forecast = optimal_model.fit(df)

results in attribute error -->

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-48-8aa3bc6f54a3> in <module>()
      2      seasonality_mode='multiplicative', weekly_seasonality=4
      3 )
----> 4 optimal_model.add_country_holidays(country_name = 'US')
      5 forecast = optimal_model.fit(df)

AttributeError: 'Prophet' object has no attribute 'add_country_holidays'

Used conda forge for Prophet installation. I am using fbrophet0.3.post2 (since conda took forever to solve env for fbprophet0.4) Python3.6 Anaconda3-5.2.0-Windows-x86_64

abhisranj commented 5 years ago

@rmax @bletham This might be related to https://github.com/facebook/prophet/issues/304 https://github.com/facebook/prophet/issues/305 https://github.com/facebook/prophet/issues/306 Pls do let me know if the new PR(https://github.com/conda-forge/fbprophet-feedstock/pull/4) merged solves this issue. I am still facing this problem.

uncleDC commented 5 years ago

I used ''conda update fbprophet'',but the version is still 0.3,how to update fbprophet to 0.4 on anaconda?

thunfischtoast commented 5 years ago

I used ''conda update fbprophet'',but the version is still 0.3,how to update fbprophet to 0.4 on anaconda?

The default channel does not contain fbprophet. The conda-forge version is managed via https://github.com/conda-forge/fbprophet-feedstock. Someone has to test and merge the newest version into that repository, then conda-forge will be able to distribute it.

bletham commented 5 years ago

We're about to push out a post release that will fix some build issues and then will work to get it into conda-forge.

bletham commented 5 years ago

The PR to get the new version into conda-forge is here: https://github.com/conda-forge/fbprophet-feedstock/pull/18 It requires some new packages to be added to conda-forge, for which PRs have also been made and are awaiting merge as described in the PR above.

bletham commented 5 years ago

This is in conda forge now.