what_if_analysis
Creates, updates, deletes, gets or lists a what_if_analysis resource.
Overview
| Name | what_if_analysis |
| Type | Resource |
| Id | aws.forecast.what_if_analysis |
Fields
The following fields are returned by SELECT queries:
- describe_what_if_analysis
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | When the what-if analysis was created. |
estimated_time_remaining_in_minutes | integer (int64) | The approximate time remaining to complete the what-if analysis, in minutes. |
forecast_arn | string | The Amazon Resource Name (ARN) of the what-if forecast. (pattern: <code>arn:([a-z\d-]+):forecast:.:.:.+</code>) |
last_modification_time | string (date-time) | The last time the resource was modified. The timestamp depends on the status of the job: CREATE_PENDING - The CreationTime. CREATE_IN_PROGRESS - The current timestamp. CREATE_STOPPING - The current timestamp. CREATE_STOPPED - When the job stopped. ACTIVE or CREATE_FAILED - When the job finished or failed. |
message | string | If an error occurred, an informational message about the error. |
status | string | The status of the what-if analysis. States include: ACTIVE CREATE_PENDING, CREATE_IN_PROGRESS, CREATE_FAILED CREATE_STOPPING, CREATE_STOPPED DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED The Status of the what-if analysis must be ACTIVE before you can access the analysis. (pattern: <code>^[a-zA-Z0-9_]+$</code>) |
time_series_selector | object | Defines the set of time series that are used to create the forecasts in a TimeSeriesIdentifiers object. The TimeSeriesIdentifiers object needs the following information: DataSource Format Schema |
what_if_analysis_arn | string | The Amazon Resource Name (ARN) of the what-if analysis. (pattern: <code>arn:([a-z\d-]+):forecast:.:.:.+</code>) |
what_if_analysis_name | string | The name of the what-if analysis. (pattern: <code>^[a-zA-Z][a-zA-Z0-9_]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_what_if_analysis | select | region | Describes the what-if analysis created using the CreateWhatIfAnalysis operation. In addition to listing the properties provided in the CreateWhatIfAnalysis request, this operation lists the following properties: CreationTime LastModificationTime Message - If an error occurred, information about the error. Status | |
create_what_if_analysis | insert | region, WhatIfAnalysisName, ForecastArn | What-if analysis is a scenario modeling technique where you make a hypothetical change to a time series and compare the forecasts generated by these changes against the baseline, unchanged time series. It is important to remember that the purpose of a what-if analysis is to understand how a forecast can change given different modifications to the baseline time series. For example, imagine you are a clothing retailer who is considering an end of season sale to clear space for new styles. After creating a baseline forecast, you can use a what-if analysis to investigate how different sales tactics might affect your goals. You could create a scenario where everything is given a 25% markdown, and another where everything is given a fixed dollar markdown. You could create a scenario where the sale lasts for one week and another where the sale lasts for one month. With a what-if analysis, you can compare many different scenarios against each other. Note that a what-if analysis is meant to display what the forecasting model has learned and how it will behave in the scenarios that you are evaluating. Do not blindly use the results of the what-if analysis to make business decisions. For instance, forecasts might not be accurate for novel scenarios where there is no reference available to determine whether a forecast is good. The TimeSeriesSelector object defines the items that you want in the what-if analysis. | |
delete_what_if_analysis | delete | region | Deletes a what-if analysis created using the CreateWhatIfAnalysis operation. You can delete only what-if analyses that have a status of ACTIVE or CREATE_FAILED. To get the status, use the DescribeWhatIfAnalysis operation. You can't delete a what-if analysis while any of its forecasts are being exported. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_what_if_analysis
Describes the what-if analysis created using the CreateWhatIfAnalysis operation. In addition to listing the properties provided in the CreateWhatIfAnalysis request, this operation lists the following properties: CreationTime LastModificationTime Message - If an error occurred, information about the error. Status
SELECT
creation_time,
estimated_time_remaining_in_minutes,
forecast_arn,
last_modification_time,
message,
status,
time_series_selector,
what_if_analysis_arn,
what_if_analysis_name
FROM aws.forecast.what_if_analysis
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_what_if_analysis
- Manifest
What-if analysis is a scenario modeling technique where you make a hypothetical change to a time series and compare the forecasts generated by these changes against the baseline, unchanged time series. It is important to remember that the purpose of a what-if analysis is to understand how a forecast can change given different modifications to the baseline time series. For example, imagine you are a clothing retailer who is considering an end of season sale to clear space for new styles. After creating a baseline forecast, you can use a what-if analysis to investigate how different sales tactics might affect your goals. You could create a scenario where everything is given a 25% markdown, and another where everything is given a fixed dollar markdown. You could create a scenario where the sale lasts for one week and another where the sale lasts for one month. With a what-if analysis, you can compare many different scenarios against each other. Note that a what-if analysis is meant to display what the forecasting model has learned and how it will behave in the scenarios that you are evaluating. Do not blindly use the results of the what-if analysis to make business decisions. For instance, forecasts might not be accurate for novel scenarios where there is no reference available to determine whether a forecast is good. The TimeSeriesSelector object defines the items that you want in the what-if analysis.
INSERT INTO aws.forecast.what_if_analysis (
WhatIfAnalysisName,
ForecastArn,
TimeSeriesSelector,
Tags,
region
)
SELECT
'{{ WhatIfAnalysisName }}' /* required */,
'{{ ForecastArn }}' /* required */,
'{{ TimeSeriesSelector }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
what_if_analysis_arn
;
# Description fields are for documentation purposes
- name: what_if_analysis
props:
- name: region
value: "{{ region }}"
description: Required parameter for the what_if_analysis resource.
- name: WhatIfAnalysisName
value: "{{ WhatIfAnalysisName }}"
description: |
The name of the what-if analysis. Each name must be unique.
- name: ForecastArn
value: "{{ ForecastArn }}"
description: |
The Amazon Resource Name (ARN) of the baseline forecast.
- name: TimeSeriesSelector
description: |
Defines the set of time series that are used in the what-if analysis with a TimeSeriesIdentifiers object. What-if analyses are performed only for the time series in this object. The TimeSeriesIdentifiers object needs the following information: DataSource Format Schema
value:
TimeSeriesIdentifiers:
DataSource:
S3Config:
Path: "{{ Path }}"
RoleArn: "{{ RoleArn }}"
KMSKeyArn: "{{ KMSKeyArn }}"
Schema:
Attributes:
- AttributeName: "{{ AttributeName }}"
AttributeType: "{{ AttributeType }}"
Format: "{{ Format }}"
- name: Tags
description: |
A list of tags to apply to the what if forecast.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
DELETE examples
- delete_what_if_analysis
Deletes a what-if analysis created using the CreateWhatIfAnalysis operation. You can delete only what-if analyses that have a status of ACTIVE or CREATE_FAILED. To get the status, use the DescribeWhatIfAnalysis operation. You can't delete a what-if analysis while any of its forecasts are being exported.
DELETE FROM aws.forecast.what_if_analysis
WHERE region = '{{ region }}' --required
;