Problem: When executing time series forecasting (Prophet), the following error occurs: “Too few data points to make a forecast. You might want to select a smaller unit of time, or if in Test Mode, set a shorter Forecasting Time Period.”
Solution:
Error Causes
- Seasonality Detection: Prophet models weekly, yearly, and custom seasonal patterns. For example, detecting annual seasonality requires at least 2 years of data.
- Trend Identification: Identifying long-term trends requires sufficient observational data to distinguish consistent patterns from short-term fluctuations.
Solutions
- Add More Data The most robust solution is to collect more historical data.
-
Recommended Data Volume: Varies by data frequency, but general recommendations are:
- Annual Seasonality: Minimum of 2 years of data required
- Monthly Data: For 12-month forecasting, minimum of 18 months of historical data required
- Daily Data: Minimum of 1 year of data required
- Reduce Time Unit Granularity When available data spans a long period but has few data points (e.g., only 20 monthly average data points over 2 years), change the forecasting time unit.
- Example: Switch from monthly forecasting to quarterly forecasting to increase the number of observations per period.