Amazon Forecast is no longer available to new customers. Existing customers of
Amazon Forecast can continue to use the service as normal.
Learn more"
Data aggregation for different forecast frequencies
When you create a predictor, you must specify a forecast frequency. The forecast frequency determines the frequency of predictions in your forecasts. For example, monthly sales forecasts. Amazon Forecast predictors can generate forecasts for data frequencies that are higher than the forecast frequency you specify. For example, you can generate weekly forecasts even if your data is recorded daily. During training, Forecast aggregates the daily data to generate forecasts at the weekly forecast frequency.
Time Boundaries
Time boundaries specify the beginning of a unit of time, such what day a week begins. Before aggregating your data, Amazon Forecast aligns the data the based on the unit of time of your forecast frequency. It does this based on the data's relation to a time boundary.
For example, if you specify a daily forecast frequency but not your own time boundary, Forecast aligns each hourly record based on the day it belongs in. Each day starts at 0 hours. The definition of when the day starts, 0 hours, is the time boundary. Then Forecast aggregates the hourly records to a single record for that day.
Forecast uses a default time boundary based on your forecast frequency's unit of time. If you create an auto predictor, you can specify a custom time boundary.
If you specify both a custom time boundary and a custom forecast frequency, Forecast aggregates your data within the forecast frequency and aligns it to the custom time boundary. The forecast frequency determines how often the data is aggregated while the custom time boundary determines where the alignment is located. For example, assume your data is collected daily and you want Amazon Forecast to generate quarterly forecasts on the 15th of the month for one year. To do so, set the forecast frequency to every 3 months and the custom time boundary to 15. See the following AWS Command Line Interface example.
aws forecast create-predictor \ --predictor-name
predictor_name
\ --data-config DatasetGroupArn="arn:aws:forecast:region
:account
:dataset-group/datasetGroupName
" \ --forecast-horizon 4 \ --forecast-frequency 3M \ --time-alignment-boundary DayOfMonth=15
In this example, all of the daily data is summed (the default aggregation) to the 15th of every third month.
Note that this aggregation does not require daily data, just that the data is collected monthly or more frequently.
Default Time Boundaries
The following table lists the default time alignment boundaries that Forecast uses when aggregating data.
Frequency | Boundary |
---|---|
Minute | Last top of the minute (45:00, 06:00) |
Hour | Last top of the hour (09:00:00, 13:00:00) |
Day | First hour of the day (hour 0) |
Week | Most recent Monday |
Month | First day of the month |
Year | First day of the year (January 1) |
Specifying a Time Boundary
Note
You can only specify a time boundary for an auto predictor.
When you create an auto predictor with a daily, weekly, monthly, or yearly forecast frequency, you can specify the time boundary that Forecast uses to aggregate data. You might specify a time boundary if your business calendar doesn't align with the default time boundaries. For example, you might want to generate monthly forecasts where each month begins on the third day of the month. If you don't specify a time boundary, Forecast uses a set of Default Time Boundaries.
The time boundary unit that you specify must be one unit finer than your forecast frequency. The following table lists the time boundary unit and values that you can specify, organized by forecast frequency.
You can only specify a Monthly
time boundary with a boundary value of 28
or
less.
Forecast frequency unit | Boundary unit | Boundary values |
---|---|---|
Daily | Hour | 0–23 |
Weekly | Day of week | Monday through Sunday |
Monthly | Day of month | 1 through 28 |
Yearly | Month | January through December |
You specify a time alignment boundary when you create a predictor as follows. For information on the different time boundary units and boundary values you can specify programmatically, see TimeAlignmentBoundary.