Amazon Forecast Service

2020/11/23 - Amazon Forecast Service - 4 new api methods

Changes  Releasing the set of PredictorBacktestExportJob APIs which allow customers to export backtest values and item-level metrics data from Predictor training.

DeletePredictorBacktestExportJob (new) Link ¶

Deletes a predictor backtest export job.

See also: AWS API Documentation

Request Syntax

client.delete_predictor_backtest_export_job(
    PredictorBacktestExportJobArn='string'
)
type PredictorBacktestExportJobArn

string

param PredictorBacktestExportJobArn

[REQUIRED]

The Amazon Resource Name (ARN) of the predictor backtest export job to delete.

returns

None

ListPredictorBacktestExportJobs (new) Link ¶

Returns a list of predictor backtest export jobs created using the CreatePredictorBacktestExportJob operation. This operation returns a summary for each backtest export job. You can filter the list using an array of Filter objects.

To retrieve the complete set of properties for a particular backtest export job, use the ARN with the DescribePredictorBacktestExportJob operation.

See also: AWS API Documentation

Request Syntax

client.list_predictor_backtest_export_jobs(
    NextToken='string',
    MaxResults=123,
    Filters=[
        {
            'Key': 'string',
            'Value': 'string',
            'Condition': 'IS'|'IS_NOT'
        },
    ]
)
type NextToken

string

param NextToken

If the result of the previous request was truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.

type MaxResults

integer

param MaxResults

The number of items to return in the response.

type Filters

list

param Filters

An array of filters. For each filter, provide a condition and a match statement. The condition is either IS or IS_NOT , which specifies whether to include or exclude the predictor backtest export jobs that match the statement from the list. The match statement consists of a key and a value.

Filter properties

  • Condition - The condition to apply. Valid values are IS and IS_NOT . To include the predictor backtest export jobs that match the statement, specify IS . To exclude matching predictor backtest export jobs, specify IS_NOT .

  • Key - The name of the parameter to filter on. Valid values are PredictorBacktestExportJobArn and Status .

  • Value - The value to match.

  • (dict) --

    Describes a filter for choosing a subset of objects. Each filter consists of a condition and a match statement. The condition is either IS or IS_NOT , which specifies whether to include or exclude the objects that match the statement, respectively. The match statement consists of a key and a value.

    • Key (string) -- [REQUIRED]

      The name of the parameter to filter on.

    • Value (string) -- [REQUIRED]

      The value to match.

    • Condition (string) -- [REQUIRED]

      The condition to apply. To include the objects that match the statement, specify IS . To exclude matching objects, specify IS_NOT .

rtype

dict

returns

Response Syntax

{
    'PredictorBacktestExportJobs': [
        {
            'PredictorBacktestExportJobArn': 'string',
            'PredictorBacktestExportJobName': 'string',
            'Destination': {
                'S3Config': {
                    'Path': 'string',
                    'RoleArn': 'string',
                    'KMSKeyArn': 'string'
                }
            },
            'Status': 'string',
            'Message': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'LastModificationTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • PredictorBacktestExportJobs (list) --

      An array of objects that summarize the properties of each predictor backtest export job.

      • (dict) --

        Provides a summary of the predictor backtest export job properties used in the ListPredictorBacktestExportJobs operation. To get a complete set of properties, call the DescribePredictorBacktestExportJob operation, and provide the listed PredictorBacktestExportJobArn .

        • PredictorBacktestExportJobArn (string) --

          The Amazon Resource Name (ARN) of the predictor backtest export job.

        • PredictorBacktestExportJobName (string) --

          The name of the predictor backtest export job.

        • Destination (dict) --

          The destination for an export job, an AWS Identity and Access Management (IAM) role that allows Amazon Forecast to access the location and, optionally, an AWS Key Management Service (KMS) key.

          • S3Config (dict) --

            The path to an Amazon Simple Storage Service (Amazon S3) bucket along with the credentials to access the bucket.

            • Path (string) --

              The path to an Amazon Simple Storage Service (Amazon S3) bucket or file(s) in an Amazon S3 bucket.

            • RoleArn (string) --

              The ARN of the AWS Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket or files. If you provide a value for the KMSKeyArn key, the role must allow access to the key.

              Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an InvalidInputException error.

            • KMSKeyArn (string) --

              The Amazon Resource Name (ARN) of an AWS Key Management Service (KMS) key.

        • Status (string) --

          The status of the predictor backtest export job. States include:

          • ACTIVE

          • CREATE_PENDING

          • CREATE_IN_PROGRESS

          • CREATE_FAILED

          • DELETE_PENDING

          • DELETE_IN_PROGRESS

          • DELETE_FAILED

        • Message (string) --

          Information about any errors that may have occurred during the backtest export.

        • CreationTime (datetime) --

          When the predictor backtest export job was created.

        • LastModificationTime (datetime) --

          When the last successful export job finished.

    • NextToken (string) --

      Returns this token if the response is truncated. To retrieve the next set of results, use the token in the next request.

CreatePredictorBacktestExportJob (new) Link ¶

Exports backtest forecasts and accuracy metrics generated by the CreatePredictor operation. Two CSV files are exported to a specified S3 bucket.

You must specify a DataDestination object that includes an AWS Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket. For more information, see aws-forecast-iam-roles.

See also: AWS API Documentation

Request Syntax

client.create_predictor_backtest_export_job(
    PredictorBacktestExportJobName='string',
    PredictorArn='string',
    Destination={
        'S3Config': {
            'Path': 'string',
            'RoleArn': 'string',
            'KMSKeyArn': 'string'
        }
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type PredictorBacktestExportJobName

string

param PredictorBacktestExportJobName

[REQUIRED]

The name for the backtest export job.

type PredictorArn

string

param PredictorArn

[REQUIRED]

The Amazon Resource Name (ARN) of the predictor that you want to export.

type Destination

dict

param Destination

[REQUIRED]

The destination for an export job, an AWS Identity and Access Management (IAM) role that allows Amazon Forecast to access the location and, optionally, an AWS Key Management Service (KMS) key.

  • S3Config (dict) -- [REQUIRED]

    The path to an Amazon Simple Storage Service (Amazon S3) bucket along with the credentials to access the bucket.

    • Path (string) -- [REQUIRED]

      The path to an Amazon Simple Storage Service (Amazon S3) bucket or file(s) in an Amazon S3 bucket.

    • RoleArn (string) -- [REQUIRED]

      The ARN of the AWS Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket or files. If you provide a value for the KMSKeyArn key, the role must allow access to the key.

      Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an InvalidInputException error.

    • KMSKeyArn (string) --

      The Amazon Resource Name (ARN) of an AWS Key Management Service (KMS) key.

type Tags

list

param Tags

Optional metadata to help you categorize and organize your backtests. Each tag consists of a key and an optional value, both of which you define. Tag keys and values are case sensitive.

The following restrictions apply to tags:

  • For each resource, each tag key must be unique and each tag key must have one value.

  • Maximum number of tags per resource: 50.

  • Maximum key length: 128 Unicode characters in UTF-8.

  • Maximum value length: 256 Unicode characters in UTF-8.

  • Accepted characters: all letters and numbers, spaces representable in UTF-8, and + - = . _ : / @. If your tagging schema is used across other services and resources, the character restrictions of those services also apply.

  • Key prefixes cannot include any upper or lowercase combination of aws: or AWS: . Values can have this prefix. If a tag value has aws as its prefix but the key does not, Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit. You cannot edit or delete tag keys with this prefix.

  • (dict) --

    The optional metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.

    The following basic restrictions apply to tags:

    • Maximum number of tags per resource - 50.

    • For each resource, each tag key must be unique, and each tag key can have only one value.

    • Maximum key length - 128 Unicode characters in UTF-8.

    • Maximum value length - 256 Unicode characters in UTF-8.

    • If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.

    • Tag keys and values are case sensitive.

    • Do not use aws: , AWS: , or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.

    • Key (string) -- [REQUIRED]

      One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

    • Value (string) -- [REQUIRED]

      The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

rtype

dict

returns

Response Syntax

{
    'PredictorBacktestExportJobArn': 'string'
}

Response Structure

  • (dict) --

    • PredictorBacktestExportJobArn (string) --

      The Amazon Resource Name (ARN) of the predictor backtest export job that you want to export.

DescribePredictorBacktestExportJob (new) Link ¶

Describes a predictor backtest export job created using the CreatePredictorBacktestExportJob operation.

In addition to listing the properties provided by the user in the CreatePredictorBacktestExportJob request, this operation lists the following properties:

  • CreationTime

  • LastModificationTime

  • Status

  • Message (if an error occurred)

See also: AWS API Documentation

Request Syntax

client.describe_predictor_backtest_export_job(
    PredictorBacktestExportJobArn='string'
)
type PredictorBacktestExportJobArn

string

param PredictorBacktestExportJobArn

[REQUIRED]

The Amazon Resource Name (ARN) of the predictor backtest export job.

rtype

dict

returns

Response Syntax

{
    'PredictorBacktestExportJobArn': 'string',
    'PredictorBacktestExportJobName': 'string',
    'PredictorArn': 'string',
    'Destination': {
        'S3Config': {
            'Path': 'string',
            'RoleArn': 'string',
            'KMSKeyArn': 'string'
        }
    },
    'Message': 'string',
    'Status': 'string',
    'CreationTime': datetime(2015, 1, 1),
    'LastModificationTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • PredictorBacktestExportJobArn (string) --

      The Amazon Resource Name (ARN) of the predictor backtest export job.

    • PredictorBacktestExportJobName (string) --

      The name of the predictor backtest export job.

    • PredictorArn (string) --

      The Amazon Resource Name (ARN) of the predictor.

    • Destination (dict) --

      The destination for an export job, an AWS Identity and Access Management (IAM) role that allows Amazon Forecast to access the location and, optionally, an AWS Key Management Service (KMS) key.

      • S3Config (dict) --

        The path to an Amazon Simple Storage Service (Amazon S3) bucket along with the credentials to access the bucket.

        • Path (string) --

          The path to an Amazon Simple Storage Service (Amazon S3) bucket or file(s) in an Amazon S3 bucket.

        • RoleArn (string) --

          The ARN of the AWS Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket or files. If you provide a value for the KMSKeyArn key, the role must allow access to the key.

          Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an InvalidInputException error.

        • KMSKeyArn (string) --

          The Amazon Resource Name (ARN) of an AWS Key Management Service (KMS) key.

    • Message (string) --

      Information about any errors that may have occurred during the backtest export.

    • Status (string) --

      The status of the predictor backtest export job. States include:

      • ACTIVE

      • CREATE_PENDING

      • CREATE_IN_PROGRESS

      • CREATE_FAILED

      • DELETE_PENDING

      • DELETE_IN_PROGRESS

      • DELETE_FAILED

    • CreationTime (datetime) --

      When the predictor backtest export job was created.

    • LastModificationTime (datetime) --

      When the last successful export job finished.