Amazon Forecast is no longer available to new customers. Existing customers of
Amazon Forecast can continue to use the service as normal.
Learn more"
Transformation Functions
A transformation function is a set of operations that select and modify the rows in a related time series. You select the rows that you want with a condition operation. You then modify the rows with a transformation operation. All conditions are joined with an AND operation, meaning that all conditions must be true for the transformation to be applied. Transformations are applied in the order that they are listed.
When you create a what-if forecast, use the Transformation function builder to specify the conditions and transformations that you want to apply. The image below illustrates this functionality.
In the highlighted section, the price
column is multiplied by 0.90 (i.e., a
10% discount) at the store in tacoma
(i.e., Tacoma, Washington) for items that
are colored blue
. To do this, Amazon Forecast first creates a subset of the baseline
related time series to contain only the rows of store
that equal
tacoma
.
That subset is further pared down to include only the rows of color
that equal blue
.
Finally, all values in the price
column are multiplied by 0.90 to create a new related time series to
use in the what-if forecast.
Amazon Forecast supports the following conditions:
EQUALS
- The value in the column is the same as the value that was provided in the condition.NOT_EQUALS
- The value in the column isn't the same as the value that was provided in the condition.LESS_THAN
- The value in the column is less than the value that was provided in the condition.GREATER_THAN
- The value in the column is greater than the value that was provided in the condition.
Amazon Forecast supports the following actions:
ADD
- Adds the provided value to all rows in the column.SUBTRACT
- Subtracts the provided value from all rows in the column.MULTIPLY
- Multiplies all rows in the column by the value provided.DIVIDE
- Divides all rows in the column by the value provided.
What follows are examples of how you can specify a time series transformation using the SDK.