m = Prophet(changepoint_prior_scale=0.5,
weekly_seasonality=15,
daily_seasonality=20,
yearly_seasonality=10).fit(data)
future = m.make_future_dataframe(periods=300, freq='5min')
m.add_seasonality(name='monthly', period=30.5, fourier_order=5)
fcst = m.predict(future)
fig = m.plot(fcst)
fig
fig = m.plot_components(fcst)
I have followed the official Propet manual, but it is hard to add the code below..
m.add_seasonality(name='monthly', period=30.5, fourier_order=5)
I get the following error…
670 if self.history is not None:
671 raise Exception(
–> 672 ‘Seasonality must be added prior to model fitting.’)
673 if name not in (‘daily’, ‘weekly’, ‘yearly’):
674 # Allow overwriting built-in seasonalities
Exception: Seasonality must be added prior to model fitting.
I am a beginner and I am studying hard.
I’m not sure how to fix it. What should I do?