facebook / facebook/prophet

How to determine the best period for cross validation?

Open
#2,198 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

Hi, I have 2 years of daily data (one data per day from Monday to Friday), plus the current year and I want to forecast up to a month and a half (45 days horizon). I set as initial one year of data but my problem is with the period, I don't know what would be the optimal period to have the lowest possible error and the correct calculation for the hyperparameters.

I know that in the documentation they explain well the horizon, initial and period and its default setting of initial = 3*horizon and period = 0.5 *horizon. I have tested with 5, 10 and 23 days and get a similar average MAPE with all, but their MAPE over the 45 day forecast are very different. This is what I get:

With period = 23 days
![image](https://user-images.githubusercontent.com/105222070/173869401-cd0c7e81-bfb5-43f8-a9c5-e0ab3975a829.png)

With period = 10 days
![image](https://user-images.githubusercontent.com/105222070/173868752-009ec76d-ea2f-4049-9d4b-d35470eb9508.png)

With period = 5 days
![image](https://user-images.githubusercontent.com/105222070/173868016-1765c0fb-02dd-4455-b649-214a9b1bf27d.png)

I tend to think that the right thing to do is to choose period = 5 because it is constant over the horizon, or even use a lower value, but I want to be sure of this. Or maybe answer what is a better criterion for choosing period?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.