Amazon Forecast
Developer Guide

This is prerelease documentation for a service in preview release. It is subject to change.

As of 6/6/19, Amazon Forecast no longer supports the following recipes: DeepAR, MDN, MLP, MQRNN, RFQR, and SQF. You can continue to use predictors created with these recipes to generate forecasts. However, you can’t use these recipes to create new predictors or to update existing predictors with new data. In addition, AutoML no longer considers these recipes. We’ve made these changes to ensure that Forecast offers the highest level of accuracy and robustness. We continue to support the ARIMA, DeepAR+, ETS, NPTS, and Prophet recipes.

CreateDataset

Creates an Amazon Forecast dataset. The information about the dataset that you provide helps Forecast understand how to consume the data for model training. This includes the following:

  • DataFormat - The format of the data that you plan to import to the dataset.

  • DataFrequency - How frequently your historical time-series data is collected, including the interval and the multiple of the interval (for example 3H, for every 3 hours). Amazon Forecast uses this information when training the model and generating forecasts.

  • Domain and DatasetType - Each dataset has an associated dataset domain and a type within the domain. Amazon Forecast provides a list of predefined domains and types within each domain. For each unique dataset domain and type within the domain, Amazon Forecast requires your data to include a minimum set of predefined fields. You identify the domain and type when you create a dataset.

  • Schema - Specify a schema only if your data doesn't include headers or if you want to customize the configuration of the schema attribute parameters.

After creating a dataset, you import your training data into the dataset and use the dataset for model training. For more information see Datasets and Dataset Groups.

Request Syntax

{ "DataFormat": "string", "DataFrequency": "string", "DatasetName": "string", "DatasetType": "string", "Domain": "string", "Schema": { "Attributes": [ { "AggregationMethod": "string", "AttributeName": "string", "AttributeType": "string", "BackFillMethod": "string", "FeatureType": "string", "FillMethod": "string", "FillValue": "string", "FrontFillMethod": "string" } ] }, "TimeStampFormat": "string" }

Request Parameters

The request accepts the following data in JSON format.

DataFormat

The format of your source data. Currently, Amazon Forecast supports only CSV format.

Type: String

Valid Values: CSV

Required: Yes

DataFrequency

The frequency of data collection.

Specify the frequency as a number and interval combination. Valid interval are M (Month), W (Week), D (Day), H (Hour), and min (Minute). For example, "5D" indicates every 5 days and "15min" indicates every 15 minutes.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

Required: No

DatasetName

A name for the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

Required: Yes

DatasetType

The type of dataset that you want to use. Valid types depend on the Domain that you choose.

Type: String

Valid Values: TARGET_TIME_SERIES | RELATED_TIME_SERIES | ITEM_METADATA

Required: Yes

Domain

The domain associated with the dataset. The Domain and DatasetType that you choose determine the fields that must be present in the training data that you import to the dataset. For example, if you choose the RETAIL domain and the TARGET_TIME_SERIES as the DatasetType, Amazon Forecast requires item_id, timestamp, and demand fields to be present in your data. For more information, see Datasets and Dataset Groups.

Type: String

Valid Values: RETAIL | CUSTOM | INVENTORY_PLANNING | EC2_CAPACITY | WORK_FORCE | WEB_TRAFFIC | METRICS

Required: Yes

Schema

The schema for the dataset. The dataset Domain and DatasetType that you choose determine the minimum required fields in your training data. Your schema must include the minimum required fields for the Domain and DatasetType that you choose. The order of the schema elements must match the order of the fields in your data. For information about required fields for a specific dataset domain and type, see Predefined Dataset Domains and Dataset Types.

Schema is optional. You can include headers in your data or define a schema that includes the required fields. Your data can also include additional fields.

If you choose to not specify a schema, your data must include headers that include the required fields for the domain and dataset type that you choose.

If you specify a schema and your data includes headers, then the schema takes precedence. Amazon Forecast ignores the headers in your data.

Type: Schema object

Required: No

TimeStampFormat

The format of timestamps in the dataset. For example, yyyy-MM-dd HH:mm:ss. For more information, see https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\-\:\.\,\'\s]+$

Required: No

Response Syntax

{ "DatasetArn": "string", "DatasetName": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

DatasetArn

The Amazon Resource Name (ARN) of the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\-\_\.\/\:]+$

DatasetName

The name of the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

Errors

InternalServiceException

Request processing has failed due to some unknown error, exception, or failure.

HTTP Status Code: 400

InvalidInputException

We can't process the request because it includes an invalid value or a value that exceeds the valid range.

HTTP Status Code: 400

ResourceAlreadyExistsException

There is already a resource with this name and characteristics. Try again with different settings.

HTTP Status Code: 400

ResourceNotFoundException

We can't find a resource with that name. Check the name and try again.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: