prophet icon indicating copy to clipboard operation
prophet copied to clipboard

What is the difference between forecasting values and predicting values using forecast?

Open dakshaladia opened this issue 7 years ago • 4 comments

Because in documentation and everywhere while calculating errors they do not consider values of the forecast, they find error using y and yhat attributes of crossvalidation.

dakshaladia avatar Jul 02 '19 09:07 dakshaladia

My understanding is that the cross_validation function basically evaluates predictions on a rolling basis. For example, if you have 2 full years worth of data, you might define these parameters for cross_validation:

initial as one year horizon as three months period as two months

What cross_validation will do is first train the model on a year (the initial) and generate a 3 month (the horizon) prediction, then calculate the error for that three month prediction. Next, it will increase the training data by 2 months (the period you define), and retrain the model and forecast 3 months ahead again. So assuming you have 24 full months of training data...

Run # Training Period Prediction Period
1 Months 1 - 12 Months 13 - 15
2 Months 1 - 14 Months 15 - 17
3 Months 1 - 16 Months 17 - 19
4 Months 1 - 18 Months 19 - 21
... ... ...

In contrast, using the forecast dataset will evaluate the performance against the whole of the model fit in one shot. The problem with that is that you're essentially evaluating model fit against training data, which is a pretty sure way to overfit.

I have personally gone for a sort of third approach; I slice off a snippet of training data and predict for the same period, then use the forecasts for only that period to evaluate model performance.

djrscally avatar Jul 05 '19 07:07 djrscally

I think the last prediction batch will be the most important because it includes most of the traning set and predict on the days that are nearest to the first future date that you define.

andrewng88 avatar Jul 22 '19 05:07 andrewng88

So, @bletham , seeing that this issue was closed and you liked djrscally's comment from July 5, 2019, is it safe to assume that the cv is in fact happening on a rolling basis as djrscally specified as opposed to a moving basis? So, for each forecast generation, given period, the training period isn't staying fixed at 1 yr and sliding, but rather getting increasing?

colella2 avatar Jun 18 '20 19:06 colella2

@colella2 that is correct, the training uses all data up to the cutoff. @djrscally's table is an accurate illustration.

bletham avatar Jul 13 '20 17:07 bletham