Prophet: How to predict by week's aggregation

Created on 17 Jan 2020  路  4Comments  路  Source: facebook/prophet

Hi! thanks for reading my question
I want to predict my date by week's aggregation, how to setting?
I try to input date like:

2018-05-13 | 4243.14
-- | --
2018-05-20 | 9081.96
2018-05-27 | 8019.98
2018-06-03 | 11141.40
2018-06-10 | 9426.36
2018-06-17 | 38182.96

But the output is still a sequential value, not an aggregation for the next week

Most helpful comment

@elamm43 thank you for answering my question.
I found an easier way to achieve it.
just do it:
future = m.make_future_dataframe(periods=0, freq='M')
This 'freq' can solve any aggregation you ask for, like '2D','3D','W'...
Details in `

All 4 comments

or month

If you have a daily forecast, and want to aggregate by month, this will work:

m.fit(trainingData)
forecast = m.predict(forecastData)[['ds', 'yhat']].set_index('ds').resample('M', convention='end').sum()

@elamm43 thank you for answering my question.
I found an easier way to achieve it.
just do it:
future = m.make_future_dataframe(periods=0, freq='M')
This 'freq' can solve any aggregation you ask for, like '2D','3D','W'...
Details in `

Was this page helpful?
0 / 5 - 0 ratings