Amazon Personalize

2022/02/02 - Amazon Personalize - 4 updated api methods

Changes  Adding minRecommendationRequestsPerSecond attribute to recommender APIs.

CreateRecommender (updated) Link ¶
Changes (request)
{'recommenderConfig': {'minRecommendationRequestsPerSecond': 'integer'}}

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

  • ListRecommenders

  • DescribeRecommender

  • UpdateRecommender

  • DeleteRecommender

See also: AWS API Documentation

Request Syntax

client.create_recommender(
    name='string',
    datasetGroupArn='string',
    recipeArn='string',
    recommenderConfig={
        'itemExplorationConfig': {
            'string': 'string'
        },
        'minRecommendationRequestsPerSecond': 123
    }
)
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.

rtype

dict

returns

Response Syntax

{
    'recommenderArn': 'string'
}

Response Structure

  • (dict) --

    • recommenderArn (string) --

      The Amazon Resource Name (ARN) of the recommender.

DescribeRecommender (updated) Link ¶
Changes (response)
{'recommender': {'latestRecommenderUpdate': {'recommenderConfig': {'minRecommendationRequestsPerSecond': 'integer'}},
                 'recommenderConfig': {'minRecommendationRequestsPerSecond': 'integer'}}}

Describes the given recommender, including its 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

When the status is CREATE FAILED , the response includes the failureReason key, which describes why.

For more information on recommenders, see CreateRecommender.

See also: AWS API Documentation

Request Syntax

client.describe_recommender(
    recommenderArn='string'
)
type recommenderArn

string

param recommenderArn

[REQUIRED]

The Amazon Resource Name (ARN) of the recommender to describe.

rtype

dict

returns

Response Syntax

{
    'recommender': {
        'recommenderArn': 'string',
        'datasetGroupArn': 'string',
        'name': 'string',
        'recipeArn': 'string',
        'recommenderConfig': {
            'itemExplorationConfig': {
                'string': 'string'
            },
            'minRecommendationRequestsPerSecond': 123
        },
        'creationDateTime': datetime(2015, 1, 1),
        'lastUpdatedDateTime': datetime(2015, 1, 1),
        'status': 'string',
        'failureReason': 'string',
        'latestRecommenderUpdate': {
            'recommenderConfig': {
                'itemExplorationConfig': {
                    'string': 'string'
                },
                'minRecommendationRequestsPerSecond': 123
            },
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1),
            'status': 'string',
            'failureReason': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • recommender (dict) --

      The properties of the recommender.

      • recommenderArn (string) --

        The Amazon Resource Name (ARN) of the recommender.

      • datasetGroupArn (string) --

        The Amazon Resource Name (ARN) of the Domain dataset group that contains the recommender.

      • name (string) --

        The name of the recommender.

      • recipeArn (string) --

        The Amazon Resource Name (ARN) of the recipe (Domain dataset group use case) that the recommender was created for.

      • recommenderConfig (dict) --

        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.

      • creationDateTime (datetime) --

        The date and time (in Unix format) that the recommender was created.

      • lastUpdatedDateTime (datetime) --

        The date and time (in Unix format) that the recommender was last updated.

      • status (string) --

        The status of the recommender.

        A recommender can be in one of the following states:

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

        • DELETE PENDING > DELETE IN_PROGRESS

      • failureReason (string) --

        If a recommender fails, the reason behind the failure.

      • latestRecommenderUpdate (dict) --

        Provides a summary of the latest updates to the recommender.

        • recommenderConfig (dict) --

          The configuration details of the recommender update.

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

        • creationDateTime (datetime) --

          The date and time (in Unix format) that the recommender update was created.

        • lastUpdatedDateTime (datetime) --

          The date and time (in Unix time) that the recommender update was last updated.

        • status (string) --

          The status of the recommender update.

          A recommender can be in one of the following states:

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

          • DELETE PENDING > DELETE IN_PROGRESS

        • failureReason (string) --

          If a recommender update fails, the reason behind the failure.

ListRecommenders (updated) Link ¶
Changes (response)
{'recommenders': {'recommenderConfig': {'minRecommendationRequestsPerSecond': 'integer'}}}

Returns a list of recommenders in a given Domain dataset group. When a Domain dataset group is not specified, all the recommenders associated with the account are listed. The response provides the properties for each recommender, including the Amazon Resource Name (ARN). For more information on recommenders, see CreateRecommender.

See also: AWS API Documentation

Request Syntax

client.list_recommenders(
    datasetGroupArn='string',
    nextToken='string',
    maxResults=123
)
type datasetGroupArn

string

param datasetGroupArn

The Amazon Resource Name (ARN) of the Domain dataset group to list the recommenders for. When a Domain dataset group is not specified, all the recommenders associated with the account are listed.

type nextToken

string

param nextToken

A token returned from the previous call to ListRecommenders for getting the next set of recommenders (if they exist).

type maxResults

integer

param maxResults

The maximum number of recommenders to return.

rtype

dict

returns

Response Syntax

{
    'recommenders': [
        {
            'name': 'string',
            'recommenderArn': 'string',
            'datasetGroupArn': 'string',
            'recipeArn': 'string',
            'recommenderConfig': {
                'itemExplorationConfig': {
                    'string': 'string'
                },
                'minRecommendationRequestsPerSecond': 123
            },
            'status': 'string',
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • recommenders (list) --

      A list of the recommenders.

      • (dict) --

        Provides a summary of the properties of the recommender.

        • name (string) --

          The name of the recommender.

        • recommenderArn (string) --

          The Amazon Resource Name (ARN) of the recommender.

        • datasetGroupArn (string) --

          The Amazon Resource Name (ARN) of the Domain dataset group that contains the recommender.

        • recipeArn (string) --

          The Amazon Resource Name (ARN) of the recipe (Domain dataset group use case) that the recommender was created for.

        • recommenderConfig (dict) --

          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.

        • status (string) --

          The status of the recommender. A recommender can be in one of the following states:

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

          • DELETE PENDING > DELETE IN_PROGRESS

        • creationDateTime (datetime) --

          The date and time (in Unix format) that the recommender was created.

        • lastUpdatedDateTime (datetime) --

          The date and time (in Unix format) that the recommender was last updated.

    • nextToken (string) --

      A token for getting the next set of recommenders (if they exist).

UpdateRecommender (updated) Link ¶
Changes (request)
{'recommenderConfig': {'minRecommendationRequestsPerSecond': 'integer'}}

Updates the recommender to modify the recommender configuration.

See also: AWS API Documentation

Request Syntax

client.update_recommender(
    recommenderArn='string',
    recommenderConfig={
        'itemExplorationConfig': {
            'string': 'string'
        },
        'minRecommendationRequestsPerSecond': 123
    }
)
type recommenderArn

string

param recommenderArn

[REQUIRED]

The Amazon Resource Name (ARN) of the recommender to modify.

type recommenderConfig

dict

param recommenderConfig

[REQUIRED]

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.

rtype

dict

returns

Response Syntax

{
    'recommenderArn': 'string'
}

Response Structure

  • (dict) --

    • recommenderArn (string) --

      The same recommender Amazon Resource Name (ARN) as given in the request.