Amazon Forecast
Developer Guide

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

Getting Started

To get started using Amazon Forecast, you do the following.

  • Create an Amazon Forecast dataset and import training data.

  • Create an Amazon Forecast predictor. The algorithm, in the recipe that you choose, trains a predictor using the datasets. You specify both the recipe and dataset when you create the predictor.

  • Deploy the predictor. Amazon Forecast uses the predictor to run inference and generate a forecast.

In this exercise, you use a modified version of a publicly available electricity usage dataset to train predictors. For more information, see ElectricityLoadDiagrams20112014 Data Set. The following are sample rows from the dataset:

2014-01-01 01:00:00, 2.53807106598985, client_0 2014-01-01 01:00:00, 23.648648648648624, client_1 2014-01-01 02:00:00, 9.648648648612345, client_0

For this exercise, you use the dataset to train a predictor, and then predict the hourly electricity usage by client.

You can use either the Amazon Forecast console or the AWS Command Line Interface (AWS CLI) for this exercise.


Before you begin, make sure that you have an AWS account and have installed the AWS CLI. For more information, see Setting Up. We also recommend that you review How Amazon Forecast Works.

Prepare Input Data

Regardless of whether you use the Amazon Forecast console or the AWS Command Line Interface (AWS CLI) to set up a forecasting project, you need to set up your input data. To prepare your data, you do the following:

  • Download training data to your computer and upload it to an Amazon Simple Storage Service (Amazon S3) bucket in your AWS account. To import your data to an Amazon Forecast dataset, you must store it in an S3 bucket.

  • Create an AWS Identity and Access Management (IAM) role. You give Amazon Forecast permission to access your S3 bucket with the IAM role. For more information about IAM roles, see IAM Roles in the IAM User Guide.

To prepare training data

  1. Download the zip file,

    For this exercise, you use the individual household electric power consumption dataset. (Dua, D. and Karra Taniskidou, E. (2017). UCI Machine Learning Repository []. Irvine, CA: University of California, School of Information and Computer Science.) We aggregate the usage data hourly.

  2. Unzip the content and save it locally as electricityusagedata.csv.

  3. Upload the data file to an S3 bucket.

    For step-by-step instructions, see Uploading Files and Folders by Using Drag and Drop in the Amazon Simple Storage Service Console User Guide.

  4. Create an IAM role.

    If you want to use the AWS CLI for the Getting Started exercise, you must create an IAM role. If you use the console, you can have it create the role for you. For step-by-step instructions, see Set Up Permissions for Amazon Forecast.

Now, use the Amazon Forecast console or the AWS CLI to train a predictor, generate a forecast, and see the forecast.

Clean Up Resources

When you are finished going through the getting started exercise, you might want to delete the resources you created. To delete the resources, you can use the Amazon Forecast console or SDKs, or the AWS Command Line Interface (AWS CLI).

You can't delete resources whose status is CREATING. You check the status using the DescribeObject APIs, for example, DescribeDataset.

Use the DeleteObject APIs to delete the resources, for example, DeleteDataset. Some resources need to be deleted before others, as shown in the following table.

To delete the training data you uploaded, electricityusagedata.csv, see How Do I Delete Objects from an S3 Bucket?.

Resource Delete First Notes
Deployed Predictor The forecast generated using the predictor will no longer be available.
Predictor All deployed predictors with the same name.
DatasetImport Predictors that use the specified dataset version. Deleting a DatasetImport deletes a specific version of a dataset.
Dataset Predictors that use any version of the dataset.

Deletes all versions of the dataset including the Dataset itself.

All DatasetImportJobs that target the dataset are also deleted.


Predictors that use the dataset group.

All datasets in the dataset group.