Amazon Personalize

2022/04/07 - Amazon Personalize - 3 new 12 updated api methods

Changes  This release provides tagging support in AWS Personalize.

ListTagsForResource (new) Link ¶

Get a list of tags attached to a resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    resourceArn='string'
)
type resourceArn

string

param resourceArn

[REQUIRED]

The resource's Amazon Resource Name.

rtype

dict

returns

Response Syntax

{
    'tags': [
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • tags (list) --

      The resource's tags.

      • (dict) --

        The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

        • tagKey (string) --

          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.

        • tagValue (string) --

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

TagResource (new) Link ¶

Add a list of tags to a resource.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    resourceArn='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type resourceArn

string

param resourceArn

[REQUIRED]

The resource's Amazon Resource Name (ARN).

type tags

list

param tags

[REQUIRED]

Tags to apply to the resource. For more information see Tagging Personalize resources.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{}

Response Structure

  • (dict) --

UntagResource (new) Link ¶

Remove tags that are attached to a resource.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    resourceArn='string',
    tagKeys=[
        'string',
    ]
)
type resourceArn

string

param resourceArn

[REQUIRED]

The resource's Amazon Resource Name (ARN).

type tagKeys

list

param tagKeys

[REQUIRED]

Keys to remove from the resource's tags.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreateBatchInferenceJob (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a batch inference job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see Creating a batch inference job.

See also: AWS API Documentation

Request Syntax

client.create_batch_inference_job(
    jobName='string',
    solutionVersionArn='string',
    filterArn='string',
    numResults=123,
    jobInput={
        's3DataSource': {
            'path': 'string',
            'kmsKeyArn': 'string'
        }
    },
    jobOutput={
        's3DataDestination': {
            'path': 'string',
            'kmsKeyArn': 'string'
        }
    },
    roleArn='string',
    batchInferenceJobConfig={
        'itemExplorationConfig': {
            'string': 'string'
        }
    },
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type jobName

string

param jobName

[REQUIRED]

The name of the batch inference job to create.

type solutionVersionArn

string

param solutionVersionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the solution version that will be used to generate the batch inference recommendations.

type filterArn

string

param filterArn

The ARN of the filter to apply to the batch inference job. For more information on using filters, see Filtering batch recommendations.

type numResults

integer

param numResults

The number of recommendations to retrieve.

type jobInput

dict

param jobInput

[REQUIRED]

The Amazon S3 path that leads to the input file to base your recommendations on. The input material must be in JSON format.

  • s3DataSource (dict) -- [REQUIRED]

    The URI of the Amazon S3 location that contains your input data. The Amazon S3 bucket must be in the same region as the API endpoint you are calling.

    • path (string) -- [REQUIRED]

      The file path of the Amazon S3 bucket.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

type jobOutput

dict

param jobOutput

[REQUIRED]

The path to the Amazon S3 bucket where the job's output will be stored.

  • s3DataDestination (dict) -- [REQUIRED]

    Information on the Amazon S3 bucket in which the batch inference job's output is stored.

    • path (string) -- [REQUIRED]

      The file path of the Amazon S3 bucket.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

type roleArn

string

param roleArn

[REQUIRED]

The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.

type batchInferenceJobConfig

dict

param batchInferenceJobConfig

The configuration details of a batch inference job.

  • itemExplorationConfig (dict) --

    A string to string map specifying the exploration configuration hyperparameters, including explorationWeight and explorationItemAgeCutOff , you want to use to configure the amount of item exploration Amazon Personalize uses when recommending items. See User-Personalization.

    • (string) --

      • (string) --

type tags

list

param tags

A list of tags to apply to the batch inference job.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'batchInferenceJobArn': 'string'
}

Response Structure

  • (dict) --

    • batchInferenceJobArn (string) --

      The ARN of the batch inference job.

CreateBatchSegmentJob (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a batch segment job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see Getting batch recommendations and user segments.

See also: AWS API Documentation

Request Syntax

client.create_batch_segment_job(
    jobName='string',
    solutionVersionArn='string',
    filterArn='string',
    numResults=123,
    jobInput={
        's3DataSource': {
            'path': 'string',
            'kmsKeyArn': 'string'
        }
    },
    jobOutput={
        's3DataDestination': {
            'path': 'string',
            'kmsKeyArn': 'string'
        }
    },
    roleArn='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type jobName

string

param jobName

[REQUIRED]

The name of the batch segment job to create.

type solutionVersionArn

string

param solutionVersionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the solution version you want the batch segment job to use to generate batch segments.

type filterArn

string

param filterArn

The ARN of the filter to apply to the batch segment job. For more information on using filters, see Filtering batch recommendations.

type numResults

integer

param numResults

The number of predicted users generated by the batch segment job for each line of input data.

type jobInput

dict

param jobInput

[REQUIRED]

The Amazon S3 path for the input data used to generate the batch segment job.

  • s3DataSource (dict) -- [REQUIRED]

    The configuration details of an Amazon S3 input or output bucket.

    • path (string) -- [REQUIRED]

      The file path of the Amazon S3 bucket.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

type jobOutput

dict

param jobOutput

[REQUIRED]

The Amazon S3 path for the bucket where the job's output will be stored.

  • s3DataDestination (dict) -- [REQUIRED]

    The configuration details of an Amazon S3 input or output bucket.

    • path (string) -- [REQUIRED]

      The file path of the Amazon S3 bucket.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

type roleArn

string

param roleArn

[REQUIRED]

The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.

type tags

list

param tags

A list of tags to apply to the batch segment job.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'batchSegmentJobArn': 'string'
}

Response Structure

  • (dict) --

    • batchSegmentJobArn (string) --

      The ARN of the batch segment job.

CreateCampaign (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a campaign that deploys a solution version. When a client calls the GetRecommendations and GetPersonalizedRanking APIs, a campaign is specified in the request.

Minimum Provisioned TPS and Auto-Scaling

A transaction is a single GetRecommendations or GetPersonalizedRanking call. Transactions per second (TPS) is the throughput and unit of billing for Amazon Personalize. The minimum provisioned TPS ( minProvisionedTPS ) specifies the baseline throughput provisioned by Amazon Personalize, and thus, the minimum billing charge.

If your TPS increases beyond minProvisionedTPS , Amazon Personalize auto-scales the provisioned capacity up and down, but never below minProvisionedTPS . There's a short time delay while the capacity is increased that might cause loss of transactions.

The actual TPS used is calculated as the average requests/second within a 5-minute window. You pay for maximum of either the minimum provisioned TPS or the actual TPS. We recommend starting with a low minProvisionedTPS , track your usage using Amazon CloudWatch metrics, and then increase the minProvisionedTPS as necessary.

Status

A campaign can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the campaign status, call DescribeCampaign.

Note

Wait until the status of the campaign is ACTIVE before asking the campaign for recommendations.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_campaign(
    name='string',
    solutionVersionArn='string',
    minProvisionedTPS=123,
    campaignConfig={
        'itemExplorationConfig': {
            'string': 'string'
        }
    },
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

A name for the new campaign. The campaign name must be unique within your account.

type solutionVersionArn

string

param solutionVersionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the solution version to deploy.

type minProvisionedTPS

integer

param minProvisionedTPS

Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support.

type campaignConfig

dict

param campaignConfig

The configuration details of a campaign.

  • itemExplorationConfig (dict) --

    Specifies the exploration configuration hyperparameters, including explorationWeight and explorationItemAgeCutOff , you want to use to configure the amount of item exploration Amazon Personalize uses when recommending items. Provide itemExplorationConfig data only if your solution uses the User-Personalization recipe.

    • (string) --

      • (string) --

type tags

list

param tags

A list of tags to apply to the campaign.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'campaignArn': 'string'
}

Response Structure

  • (dict) --

    • campaignArn (string) --

      The Amazon Resource Name (ARN) of the campaign.

CreateDataset (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates an empty dataset and adds it to the specified dataset group. Use CreateDatasetImportJob to import your training data to a dataset.

There are three types of datasets:

  • Interactions

  • Items

  • Users

Each dataset type has an associated schema with required field types. Only the Interactions dataset is required in order to train a model (also referred to as creating a solution).

A dataset can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the status of the dataset, call DescribeDataset.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_dataset(
    name='string',
    schemaArn='string',
    datasetGroupArn='string',
    datasetType='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

The name for the dataset.

type schemaArn

string

param schemaArn

[REQUIRED]

The ARN of the schema to associate with the dataset. The schema defines the dataset fields.

type datasetGroupArn

string

param datasetGroupArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset group to add the dataset to.

type datasetType

string

param datasetType

[REQUIRED]

The type of dataset.

One of the following (case insensitive) values:

  • Interactions

  • Items

  • Users

type tags

list

param tags

A list of tags to apply to the dataset.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'datasetArn': 'string'
}

Response Structure

  • (dict) --

    • datasetArn (string) --

      The ARN of the dataset.

CreateDatasetExportJob (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a job that exports data from your dataset to an Amazon S3 bucket. To allow Amazon Personalize to export the training data, you must specify an service-linked IAM role that gives Amazon Personalize PutObject permissions for your Amazon S3 bucket. For information, see Exporting a dataset in the Amazon Personalize developer guide.

Status

A dataset export job can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

To get the status of the export job, call DescribeDatasetExportJob, and specify the Amazon Resource Name (ARN) of the dataset export job. The dataset export is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the job failed.

See also: AWS API Documentation

Request Syntax

client.create_dataset_export_job(
    jobName='string',
    datasetArn='string',
    ingestionMode='BULK'|'PUT'|'ALL',
    roleArn='string',
    jobOutput={
        's3DataDestination': {
            'path': 'string',
            'kmsKeyArn': 'string'
        }
    },
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type jobName

string

param jobName

[REQUIRED]

The name for the dataset export job.

type datasetArn

string

param datasetArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset that contains the data to export.

type ingestionMode

string

param ingestionMode

The data to export, based on how you imported the data. You can choose to export only BULK data that you imported using a dataset import job, only PUT data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or ALL for both types. The default value is PUT .

type roleArn

string

param roleArn

[REQUIRED]

The Amazon Resource Name (ARN) of the IAM service role that has permissions to add data to your output Amazon S3 bucket.

type jobOutput

dict

param jobOutput

[REQUIRED]

The path to the Amazon S3 bucket where the job's output is stored.

  • s3DataDestination (dict) -- [REQUIRED]

    The configuration details of an Amazon S3 input or output bucket.

    • path (string) -- [REQUIRED]

      The file path of the Amazon S3 bucket.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

type tags

list

param tags

A list of tags to apply to the dataset export job.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'datasetExportJobArn': 'string'
}

Response Structure

  • (dict) --

    • datasetExportJobArn (string) --

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

CreateDatasetGroup (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates an empty dataset group. A dataset group is a container for Amazon Personalize resources. A dataset group can contain at most three datasets, one for each type of dataset:

  • Interactions

  • Items

  • Users

A dataset group can be a Domain dataset group, where you specify a domain and use pre-configured resources like recommenders, or a Custom dataset group, where you use custom resources, such as a solution with a solution version, that you deploy with a campaign. If you start with a Domain dataset group, you can still add custom resources such as solutions and solution versions trained with recipes for custom use cases and deployed with campaigns.

A dataset group can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING

To get the status of the dataset group, call DescribeDatasetGroup. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the creation failed.

Note

You must wait until the status of the dataset group is ACTIVE before adding a dataset to the group.

You can specify an Key Management Service (KMS) key to encrypt the datasets in the group. If you specify a KMS key, you must also include an Identity and Access Management (IAM) role that has permission to access the key.

APIs that require a dataset group ARN in the request

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_dataset_group(
    name='string',
    roleArn='string',
    kmsKeyArn='string',
    domain='ECOMMERCE'|'VIDEO_ON_DEMAND',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

The name for the new dataset group.

type roleArn

string

param roleArn

The ARN of the Identity and Access Management (IAM) role that has permissions to access the Key Management Service (KMS) key. Supplying an IAM role is only valid when also specifying a KMS key.

type kmsKeyArn

string

param kmsKeyArn

The Amazon Resource Name (ARN) of a Key Management Service (KMS) key used to encrypt the datasets.

type domain

string

param domain

The domain of the dataset group. Specify a domain to create a Domain dataset group. The domain you specify determines the default schemas for datasets and the use cases available for recommenders. If you don't specify a domain, you create a Custom dataset group with solution versions that you deploy with a campaign.

type tags

list

param tags

A list of tags to apply to the dataset group.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'datasetGroupArn': 'string',
    'domain': 'ECOMMERCE'|'VIDEO_ON_DEMAND'
}

Response Structure

  • (dict) --

    • datasetGroupArn (string) --

      The Amazon Resource Name (ARN) of the new dataset group.

    • domain (string) --

      The domain for the new Domain dataset group.

CreateDatasetImportJob (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a job that imports training data from your data source (an Amazon S3 bucket) to an Amazon Personalize dataset. To allow Amazon Personalize to import the training data, you must specify an IAM service role that has permission to read from the data source, as Amazon Personalize makes a copy of your data and processes it internally. For information on granting access to your Amazon S3 bucket, see Giving Amazon Personalize Access to Amazon S3 Resources.

Warning

The dataset import job replaces any existing data in the dataset that you imported in bulk.

Status

A dataset import job can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

To get the status of the import job, call DescribeDatasetImportJob, providing the Amazon Resource Name (ARN) of the dataset import job. The dataset import is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the job failed.

Note

Importing takes time. You must wait until the status shows as ACTIVE before training a model using the dataset.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_dataset_import_job(
    jobName='string',
    datasetArn='string',
    dataSource={
        'dataLocation': 'string'
    },
    roleArn='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type jobName

string

param jobName

[REQUIRED]

The name for the dataset import job.

type datasetArn

string

param datasetArn

[REQUIRED]

The ARN of the dataset that receives the imported data.

type dataSource

dict

param dataSource

[REQUIRED]

The Amazon S3 bucket that contains the training data to import.

  • dataLocation (string) --

    The path to the Amazon S3 bucket where the data that you want to upload to your dataset is stored. For example:

    s3://bucket-name/folder-name/

type roleArn

string

param roleArn

[REQUIRED]

The ARN of the IAM role that has permissions to read from the Amazon S3 data source.

type tags

list

param tags

A list of tags to apply to the dataset import job.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'datasetImportJobArn': 'string'
}

Response Structure

  • (dict) --

    • datasetImportJobArn (string) --

      The ARN of the dataset import job.

CreateEventTracker (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates an event tracker that you use when adding event data to a specified dataset group using the PutEvents API.

Note

Only one event tracker can be associated with a dataset group. You will get an error if you call CreateEventTracker using the same dataset group as an existing event tracker.

When you create an event tracker, the response includes a tracking ID, which you pass as a parameter when you use the PutEvents operation. Amazon Personalize then appends the event data to the Interactions dataset of the dataset group you specify in your event tracker.

The event tracker can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the status of the event tracker, call DescribeEventTracker.

Note

The event tracker must be in the ACTIVE state before using the tracking ID.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_event_tracker(
    name='string',
    datasetGroupArn='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

The name for the event tracker.

type datasetGroupArn

string

param datasetGroupArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset group that receives the event data.

type tags

list

param tags

A list of tags to apply to the event tracker.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'eventTrackerArn': 'string',
    'trackingId': 'string'
}

Response Structure

  • (dict) --

    • eventTrackerArn (string) --

      The ARN of the event tracker.

    • trackingId (string) --

      The ID of the event tracker. Include this ID in requests to the PutEvents API.

CreateFilter (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a recommendation filter. For more information, see Filtering recommendations and user segments.

See also: AWS API Documentation

Request Syntax

client.create_filter(
    name='string',
    datasetGroupArn='string',
    filterExpression='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

The name of the filter to create.

type datasetGroupArn

string

param datasetGroupArn

[REQUIRED]

The ARN of the dataset group that the filter will belong to.

type filterExpression

string

param filterExpression

[REQUIRED]

The filter expression defines which items are included or excluded from recommendations. Filter expression must follow specific format rules. For information about filter expression structure and syntax, see Filter expressions.

type tags

list

param tags

A list of tags to apply to the filter.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'filterArn': 'string'
}

Response Structure

  • (dict) --

    • filterArn (string) --

      The ARN of the new filter.

CreateRecommender (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates a recommender with the recipe (a Domain dataset group use case) you specify. You create recommenders for a Domain dataset group and specify the recommender's Amazon Resource Name (ARN) when you make a GetRecommendations request.

Minimum recommendation requests per second

When you create a recommender, you can configure the recommender's minimum recommendation requests per second. The minimum recommendation requests per second ( minRecommendationRequestsPerSecond ) specifies the baseline recommendation request throughput provisioned by Amazon Personalize. The default minRecommendationRequestsPerSecond is 1 . A recommendation request is a single GetRecommendations operation. Request throughput is measured in requests per second and Amazon Personalize uses your requests per second to derive your requests per hour and the price of your recommender usage.

If your requests per second increases beyond minRecommendationRequestsPerSecond , Amazon Personalize auto-scales the provisioned capacity up and down, but never below minRecommendationRequestsPerSecond . There's a short time delay while the capacity is increased that might cause loss of requests.

Your bill is the greater of either the minimum requests per hour (based on minRecommendationRequestsPerSecond) or the actual number of requests. The actual request throughput used is calculated as the average requests/second within a one-hour window. We recommend starting with the default minRecommendationRequestsPerSecond , track your usage using Amazon CloudWatch metrics, and then increase the minRecommendationRequestsPerSecond as necessary.

Status

A recommender can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the recommender status, call DescribeRecommender.

Note

Wait until the status of the recommender is ACTIVE before asking the recommender for recommendations.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_recommender(
    name='string',
    datasetGroupArn='string',
    recipeArn='string',
    recommenderConfig={
        'itemExplorationConfig': {
            'string': 'string'
        },
        'minRecommendationRequestsPerSecond': 123
    },
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

The name of the recommender.

type datasetGroupArn

string

param datasetGroupArn

[REQUIRED]

The Amazon Resource Name (ARN) of the destination domain dataset group for the recommender.

type recipeArn

string

param recipeArn

[REQUIRED]

The Amazon Resource Name (ARN) of the recipe that the recommender will use. For a recommender, a recipe is a Domain dataset group use case. Only Domain dataset group use cases can be used to create a recommender. For information about use cases see Choosing recommender use cases.

type recommenderConfig

dict

param recommenderConfig

The configuration details of the recommender.

  • itemExplorationConfig (dict) --

    Specifies the exploration configuration hyperparameters, including explorationWeight and explorationItemAgeCutOff , you want to use to configure the amount of item exploration Amazon Personalize uses when recommending items. Provide itemExplorationConfig data only if your recommenders generate personalized recommendations for a user (not popular items or similar items).

    • (string) --

      • (string) --

  • minRecommendationRequestsPerSecond (integer) --

    Specifies the requested minimum provisioned recommendation requests per second that Amazon Personalize will support.

type tags

list

param tags

A list of tags to apply to the recommender.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'recommenderArn': 'string'
}

Response Structure

  • (dict) --

    • recommenderArn (string) --

      The Amazon Resource Name (ARN) of the recommender.

CreateSolution (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Creates the configuration for training a model. A trained model is known as a solution. After the configuration is created, you train the model (create a solution) by calling the CreateSolutionVersion operation. Every time you call CreateSolutionVersion , a new version of the solution is created.

After creating a solution version, you check its accuracy by calling GetSolutionMetrics. When you are satisfied with the version, you deploy it using CreateCampaign. The campaign provides recommendations to a client through the GetRecommendations API.

To train a model, Amazon Personalize requires training data and a recipe. The training data comes from the dataset group that you provide in the request. A recipe specifies the training algorithm and a feature transformation. You can specify one of the predefined recipes provided by Amazon Personalize. Alternatively, you can specify performAutoML and Amazon Personalize will analyze your data and select the optimum USER_PERSONALIZATION recipe for you.

Note

Amazon Personalize doesn't support configuring the hpoObjective for solution hyperparameter optimization at this time.

Status

A solution can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the status of the solution, call DescribeSolution. Wait until the status shows as ACTIVE before calling CreateSolutionVersion .

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_solution(
    name='string',
    performHPO=True|False,
    performAutoML=True|False,
    recipeArn='string',
    datasetGroupArn='string',
    eventType='string',
    solutionConfig={
        'eventValueThreshold': 'string',
        'hpoConfig': {
            'hpoObjective': {
                'type': 'string',
                'metricName': 'string',
                'metricRegex': 'string'
            },
            'hpoResourceConfig': {
                'maxNumberOfTrainingJobs': 'string',
                'maxParallelTrainingJobs': 'string'
            },
            'algorithmHyperParameterRanges': {
                'integerHyperParameterRanges': [
                    {
                        'name': 'string',
                        'minValue': 123,
                        'maxValue': 123
                    },
                ],
                'continuousHyperParameterRanges': [
                    {
                        'name': 'string',
                        'minValue': 123.0,
                        'maxValue': 123.0
                    },
                ],
                'categoricalHyperParameterRanges': [
                    {
                        'name': 'string',
                        'values': [
                            'string',
                        ]
                    },
                ]
            }
        },
        'algorithmHyperParameters': {
            'string': 'string'
        },
        'featureTransformationParameters': {
            'string': 'string'
        },
        'autoMLConfig': {
            'metricName': 'string',
            'recipeList': [
                'string',
            ]
        },
        'optimizationObjective': {
            'itemAttribute': 'string',
            'objectiveSensitivity': 'LOW'|'MEDIUM'|'HIGH'|'OFF'
        }
    },
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type name

string

param name

[REQUIRED]

The name for the solution.

type performHPO

boolean

param performHPO

Whether to perform hyperparameter optimization (HPO) on the specified or selected recipe. The default is false .

When performing AutoML, this parameter is always true and you should not set it to false .

type performAutoML

boolean

param performAutoML

Whether to perform automated machine learning (AutoML). The default is false . For this case, you must specify recipeArn .

When set to true , Amazon Personalize analyzes your training data and selects the optimal USER_PERSONALIZATION recipe and hyperparameters. In this case, you must omit recipeArn . Amazon Personalize determines the optimal recipe by running tests with different values for the hyperparameters. AutoML lengthens the training process as compared to selecting a specific recipe.

type recipeArn

string

param recipeArn

The ARN of the recipe to use for model training. Only specified when performAutoML is false.

type datasetGroupArn

string

param datasetGroupArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset group that provides the training data.

type eventType

string

param eventType

When your have multiple event types (using an EVENT_TYPE schema field), this parameter specifies which event type (for example, 'click' or 'like') is used for training the model.

If you do not provide an eventType , Amazon Personalize will use all interactions for training with equal weight regardless of type.

type solutionConfig

dict

param solutionConfig

The configuration to use with the solution. When performAutoML is set to true, Amazon Personalize only evaluates the autoMLConfig section of the solution configuration.

Note

Amazon Personalize doesn't support configuring the hpoObjective at this time.

  • eventValueThreshold (string) --

    Only events with a value greater than or equal to this threshold are used for training a model.

  • hpoConfig (dict) --

    Describes the properties for hyperparameter optimization (HPO).

    • hpoObjective (dict) --

      The metric to optimize during HPO.

      Note

      Amazon Personalize doesn't support configuring the hpoObjective at this time.

      • type (string) --

        The type of the metric. Valid values are Maximize and Minimize .

      • metricName (string) --

        The name of the metric.

      • metricRegex (string) --

        A regular expression for finding the metric in the training job logs.

    • hpoResourceConfig (dict) --

      Describes the resource configuration for HPO.

      • maxNumberOfTrainingJobs (string) --

        The maximum number of training jobs when you create a solution version. The maximum value for maxNumberOfTrainingJobs is 40 .

      • maxParallelTrainingJobs (string) --

        The maximum number of parallel training jobs when you create a solution version. The maximum value for maxParallelTrainingJobs is 10 .

    • algorithmHyperParameterRanges (dict) --

      The hyperparameters and their allowable ranges.

      • integerHyperParameterRanges (list) --

        The integer-valued hyperparameters and their ranges.

        • (dict) --

          Provides the name and range of an integer-valued hyperparameter.

          • name (string) --

            The name of the hyperparameter.

          • minValue (integer) --

            The minimum allowable value for the hyperparameter.

          • maxValue (integer) --

            The maximum allowable value for the hyperparameter.

      • continuousHyperParameterRanges (list) --

        The continuous hyperparameters and their ranges.

        • (dict) --

          Provides the name and range of a continuous hyperparameter.

          • name (string) --

            The name of the hyperparameter.

          • minValue (float) --

            The minimum allowable value for the hyperparameter.

          • maxValue (float) --

            The maximum allowable value for the hyperparameter.

      • categoricalHyperParameterRanges (list) --

        The categorical hyperparameters and their ranges.

        • (dict) --

          Provides the name and range of a categorical hyperparameter.

          • name (string) --

            The name of the hyperparameter.

          • values (list) --

            A list of the categories for the hyperparameter.

            • (string) --

  • algorithmHyperParameters (dict) --

    Lists the hyperparameter names and ranges.

    • (string) --

      • (string) --

  • featureTransformationParameters (dict) --

    Lists the feature transformation parameters.

    • (string) --

      • (string) --

  • autoMLConfig (dict) --

    The AutoMLConfig object containing a list of recipes to search when AutoML is performed.

    • metricName (string) --

      The metric to optimize.

    • recipeList (list) --

      The list of candidate recipes.

      • (string) --

  • optimizationObjective (dict) --

    Describes the additional objective for the solution, such as maximizing streaming minutes or increasing revenue. For more information see Optimizing a solution.

    • itemAttribute (string) --

      The numerical metadata column in an Items dataset related to the optimization objective. For example, VIDEO_LENGTH (to maximize streaming minutes), or PRICE (to maximize revenue).

    • objectiveSensitivity (string) --

      Specifies how Amazon Personalize balances the importance of your optimization objective versus relevance.

type tags

list

param tags

A list of tags to apply to the solution.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'solutionArn': 'string'
}

Response Structure

  • (dict) --

    • solutionArn (string) --

      The ARN of the solution.

CreateSolutionVersion (updated) Link ¶
Changes (request)
{'tags': [{'tagKey': 'string', 'tagValue': 'string'}]}

Trains or retrains an active solution in a Custom dataset group. A solution is created using the CreateSolution operation and must be in the ACTIVE state before calling CreateSolutionVersion . A new version of the solution is created every time you call this operation.

Status

A solution version can be in one of the following states:

  • CREATE PENDING

  • CREATE IN_PROGRESS

  • ACTIVE

  • CREATE FAILED

  • CREATE STOPPING

  • CREATE STOPPED

To get the status of the version, call DescribeSolutionVersion. Wait until the status shows as ACTIVE before calling CreateCampaign .

If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the job failed.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_solution_version(
    solutionArn='string',
    trainingMode='FULL'|'UPDATE',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ]
)
type solutionArn

string

param solutionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the solution containing the training configuration information.

type trainingMode

string

param trainingMode

The scope of training to be performed when creating the solution version. The FULL option trains the solution version based on the entirety of the input solution's training data, while the UPDATE option processes only the data that has changed in comparison to the input solution. Choose UPDATE when you want to incrementally update your solution version instead of creating an entirely new one.

Warning

The UPDATE option can only be used when you already have an active solution version created from the input solution using the FULL option and the input solution was trained with the User-Personalization recipe or the HRNN-Coldstart recipe.

type tags

list

param tags

A list of tags to apply to the solution version.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (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.

    • tagValue (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

{
    'solutionVersionArn': 'string'
}

Response Structure

  • (dict) --

    • solutionVersionArn (string) --

      The ARN of the new solution version.