2024/04/19 - Amazon Personalize - 8 updated api methods
Changes This releases auto training capability while creating a solution and automatically syncing latest solution versions when creating/updating a campaign
{'campaignConfig': {'syncWithLatestSolutionVersion': 'boolean'}}
Warning
You incur campaign costs while it is active. To avoid unnecessary costs, make sure to delete the campaign when you are finished. For information about campaign costs, see Amazon Personalize pricing.
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
Warning
A high minProvisionedTPS will increase your cost. We recommend starting with 1 for minProvisionedTPS (the default). Track your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS as necessary.
When you create an Amazon Personalize campaign, you can specify the minimum provisioned transactions per second ( minProvisionedTPS ) for the campaign. This is the baseline transaction throughput for the campaign provisioned by Amazon Personalize. It sets the minimum billing charge for the campaign while it is active. A transaction is a single GetRecommendations or GetPersonalizedRanking request. The default minProvisionedTPS is 1.
If your TPS increases beyond the 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. When your traffic reduces, capacity returns to the minProvisionedTPS .
You are charged for the the minimum provisioned TPS or, if your requests exceed the minProvisionedTPS , the actual TPS. The actual TPS is the total number of recommendation requests you make. We recommend starting with a low minProvisionedTPS , track your usage using Amazon CloudWatch metrics, and then increase the minProvisionedTPS as necessary.
For more information about campaign costs, see Amazon Personalize pricing.
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' }, 'enableMetadataWithRecommendations': True|False, 'syncWithLatestSolutionVersion': True|False }, tags=[ { 'tagKey': 'string', 'tagValue': 'string' }, ] )
string
[REQUIRED]
A name for the new campaign. The campaign name must be unique within your account.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. To specify the latest solution version of your solution, specify the ARN of your solution in SolutionArn/$LATEST format. You must use this format if you set syncWithLatestSolutionVersion to True in the CampaignConfig.
To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.
For more information about automatic campaign updates, see Enabling automatic campaign updates.
integer
Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high minProvisionedTPS will increase your bill. We recommend starting with 1 for minProvisionedTPS (the default). Track your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS as necessary.
dict
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) --
enableMetadataWithRecommendations (boolean) --
Whether metadata with recommendations is enabled for the campaign. If enabled, you can specify the columns from your Items dataset in your request for recommendations. Amazon Personalize returns this data for each item in the recommendation response. For information about enabling metadata for a campaign, see Enabling metadata in recommendations for a campaign.
If you enable metadata in recommendations, you will incur additional costs. For more information, see Amazon Personalize pricing.
syncWithLatestSolutionVersion (boolean) --
Whether the campaign automatically updates to use the latest solution version (trained model) of a solution. If you specify True , you must specify the ARN of your solution for the SolutionVersionArn parameter. It must be in SolutionArn/$LATEST format. The default is False and you must manually update the campaign to deploy the latest solution version.
For more information about automatic campaign updates, see Enabling automatic campaign updates.
list
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 Amazon 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).
dict
Response Syntax
{ 'campaignArn': 'string' }
Response Structure
(dict) --
campaignArn (string) --
The Amazon Resource Name (ARN) of the campaign.
{'performAutoTraining': 'boolean', 'solutionConfig': {'autoTrainingConfig': {'schedulingExpression': 'string'}}}
Warning
After you create a solution, you can’t change its configuration. By default, all new solutions use automatic training. With automatic training, you incur training costs while your solution is active. You can't stop automatic training for a solution. To avoid unnecessary costs, make sure to delete the solution when you are finished. For information about training costs, see Amazon Personalize pricing.
Creates the configuration for training a model (creating a solution version). This configuration includes the recipe to use for model training and optional training configuration, such as columns to use in training and feature transformation parameters. For more information about configuring a solution, see Creating and configuring a solution.
By default, new solutions use automatic training to create solution versions every 7 days. You can change the training frequency. Automatic solution version creation starts one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training. For more information, see Configuring automatic training.
To turn off automatic training, set performAutoTraining to false. If you turn off automatic training, you must manually create a solution version by calling the CreateSolutionVersion operation.
After training starts, you can get the solution version's Amazon Resource Name (ARN) with the ListSolutionVersions API operation. To get its status, use the DescribeSolutionVersion.
After training completes you can evaluate model accuracy by calling GetSolutionMetrics. When you are satisfied with the solution version, you deploy it using CreateCampaign. The campaign provides recommendations to a client through the GetRecommendations API.
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. If you use manual training, the status must be ACTIVE before you call CreateSolutionVersion .
Related APIs
See also: AWS API Documentation
Request Syntax
client.create_solution( name='string', performHPO=True|False, performAutoML=True|False, performAutoTraining=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' }, 'trainingDataConfig': { 'excludedDatasetColumns': { 'string': [ 'string', ] } }, 'autoTrainingConfig': { 'schedulingExpression': 'string' } }, tags=[ { 'tagKey': 'string', 'tagValue': 'string' }, ] )
string
[REQUIRED]
The name for the solution.
boolean
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 .
boolean
Warning
We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see Choosing a recipe.
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.
boolean
Whether the solution uses automatic training to create new solution versions (trained models). The default is True and the solution automatically creates new solution versions every 7 days. You can change the training frequency by specifying a schedulingExpression in the AutoTrainingConfig as part of solution configuration. For more information about automatic training, see Configuring automatic training.
Automatic solution version creation starts one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training.
After training starts, you can get the solution version's Amazon Resource Name (ARN) with the ListSolutionVersions API operation. To get its status, use the DescribeSolutionVersion.
string
The Amazon Resource Name (ARN) of the recipe to use for model training. This is required when performAutoML is false. For information about different Amazon Personalize recipes and their ARNs, see Choosing a recipe.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the dataset group that provides the training data.
string
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.
dict
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 algorithm hyperparameters and their values.
(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.
trainingDataConfig (dict) --
Specifies the training data configuration to use when creating a custom solution version (trained model).
excludedDatasetColumns (dict) --
Specifies the columns to exclude from training. Each key is a dataset type, and each value is a list of columns. Exclude columns to control what data Amazon Personalize uses to generate recommendations.
For example, you might have a column that you want to use only to filter recommendations. You can exclude this column from training and Amazon Personalize considers it only when filtering.
(string) --
(list) --
(string) --
autoTrainingConfig (dict) --
Specifies the automatic training configuration to use.
schedulingExpression (string) --
Specifies how often to automatically train new solution versions. Specify a rate expression in rate(value unit ) format. For value, specify a number between 1 and 30. For unit, specify day or days . For example, to automatically create a new solution version every 5 days, specify rate(5 days) . The default is every 7 days.
For more information about auto training, see Creating and configuring a solution.
list
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 Amazon 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).
dict
Response Syntax
{ 'solutionArn': 'string' }
Response Structure
(dict) --
solutionArn (string) --
The ARN of the solution.
{'trainingMode': {'AUTOTRAIN'}}
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( name='string', solutionArn='string', trainingMode='FULL'|'UPDATE'|'AUTOTRAIN', tags=[ { 'tagKey': 'string', 'tagValue': 'string' }, ] )
string
The name of the solution version.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the solution containing the training configuration information.
string
The scope of training to be performed when creating the solution version. The default is FULL . This creates a completely new model based on the entirety of the training data from the datasets in your dataset group.
If you use User-Personalization, you can specify a training mode of UPDATE . This updates the model to consider new items for recommendations. It is not a full retraining. You should still complete a full retraining weekly. If you specify UPDATE , Amazon Personalize will stop automatic updates for the solution version. To resume updates, create a new solution with training mode set to FULL and deploy it in a campaign. For more information about automatic updates, see Automatic updates.
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 legacy HRNN-Coldstart recipe.
list
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 Amazon 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).
dict
Response Syntax
{ 'solutionVersionArn': 'string' }
Response Structure
(dict) --
solutionVersionArn (string) --
The ARN of the new solution version.
{'campaign': {'campaignConfig': {'syncWithLatestSolutionVersion': 'boolean'}, 'latestCampaignUpdate': {'campaignConfig': {'syncWithLatestSolutionVersion': 'boolean'}}}}
Describes the given campaign, including its 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
When the status is CREATE FAILED , the response includes the failureReason key, which describes why.
For more information on campaigns, see CreateCampaign.
See also: AWS API Documentation
Request Syntax
client.describe_campaign( campaignArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the campaign.
dict
Response Syntax
{ 'campaign': { 'name': 'string', 'campaignArn': 'string', 'solutionVersionArn': 'string', 'minProvisionedTPS': 123, 'campaignConfig': { 'itemExplorationConfig': { 'string': 'string' }, 'enableMetadataWithRecommendations': True|False, 'syncWithLatestSolutionVersion': True|False }, 'status': 'string', 'failureReason': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'latestCampaignUpdate': { 'solutionVersionArn': 'string', 'minProvisionedTPS': 123, 'campaignConfig': { 'itemExplorationConfig': { 'string': 'string' }, 'enableMetadataWithRecommendations': True|False, 'syncWithLatestSolutionVersion': True|False }, 'status': 'string', 'failureReason': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1) } } }
Response Structure
(dict) --
campaign (dict) --
The properties of the campaign.
name (string) --
The name of the campaign.
campaignArn (string) --
The Amazon Resource Name (ARN) of the campaign.
solutionVersionArn (string) --
The Amazon Resource Name (ARN) of the solution version the campaign uses.
minProvisionedTPS (integer) --
Specifies the requested minimum provisioned transactions (recommendations) per second. A high minProvisionedTPS will increase your bill. We recommend starting with 1 for minProvisionedTPS (the default). Track your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS as necessary.
campaignConfig (dict) --
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) --
enableMetadataWithRecommendations (boolean) --
Whether metadata with recommendations is enabled for the campaign. If enabled, you can specify the columns from your Items dataset in your request for recommendations. Amazon Personalize returns this data for each item in the recommendation response. For information about enabling metadata for a campaign, see Enabling metadata in recommendations for a campaign.
If you enable metadata in recommendations, you will incur additional costs. For more information, see Amazon Personalize pricing.
syncWithLatestSolutionVersion (boolean) --
Whether the campaign automatically updates to use the latest solution version (trained model) of a solution. If you specify True , you must specify the ARN of your solution for the SolutionVersionArn parameter. It must be in SolutionArn/$LATEST format. The default is False and you must manually update the campaign to deploy the latest solution version.
For more information about automatic campaign updates, see Enabling automatic campaign updates.
status (string) --
The status of the campaign.
A campaign 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 campaign fails, the reason behind the failure.
creationDateTime (datetime) --
The date and time (in Unix format) that the campaign was created.
lastUpdatedDateTime (datetime) --
The date and time (in Unix format) that the campaign was last updated.
latestCampaignUpdate (dict) --
Provides a summary of the properties of a campaign update. For a complete listing, call the DescribeCampaign API.
solutionVersionArn (string) --
The Amazon Resource Name (ARN) of the deployed solution version.
minProvisionedTPS (integer) --
Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support.
campaignConfig (dict) --
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) --
enableMetadataWithRecommendations (boolean) --
Whether metadata with recommendations is enabled for the campaign. If enabled, you can specify the columns from your Items dataset in your request for recommendations. Amazon Personalize returns this data for each item in the recommendation response. For information about enabling metadata for a campaign, see Enabling metadata in recommendations for a campaign.
If you enable metadata in recommendations, you will incur additional costs. For more information, see Amazon Personalize pricing.
syncWithLatestSolutionVersion (boolean) --
Whether the campaign automatically updates to use the latest solution version (trained model) of a solution. If you specify True , you must specify the ARN of your solution for the SolutionVersionArn parameter. It must be in SolutionArn/$LATEST format. The default is False and you must manually update the campaign to deploy the latest solution version.
For more information about automatic campaign updates, see Enabling automatic campaign updates.
status (string) --
The status of the campaign update.
A campaign update 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 campaign update fails, the reason behind the failure.
creationDateTime (datetime) --
The date and time (in Unix time) that the campaign update was created.
lastUpdatedDateTime (datetime) --
The date and time (in Unix time) that the campaign update was last updated.
{'solution': {'latestSolutionVersion': {'trainingMode': 'FULL | UPDATE | ' 'AUTOTRAIN', 'trainingType': 'AUTOMATIC | MANUAL'}, 'performAutoTraining': 'boolean', 'solutionConfig': {'autoTrainingConfig': {'schedulingExpression': 'string'}}}}
Describes a solution. For more information on solutions, see CreateSolution.
See also: AWS API Documentation
Request Syntax
client.describe_solution( solutionArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the solution to describe.
dict
Response Syntax
{ 'solution': { 'name': 'string', 'solutionArn': 'string', 'performHPO': True|False, 'performAutoML': True|False, 'performAutoTraining': 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' }, 'trainingDataConfig': { 'excludedDatasetColumns': { 'string': [ 'string', ] } }, 'autoTrainingConfig': { 'schedulingExpression': 'string' } }, 'autoMLResult': { 'bestRecipeArn': 'string' }, 'status': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'latestSolutionVersion': { 'solutionVersionArn': 'string', 'status': 'string', 'trainingMode': 'FULL'|'UPDATE'|'AUTOTRAIN', 'trainingType': 'AUTOMATIC'|'MANUAL', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'failureReason': 'string' } } }
Response Structure
(dict) --
solution (dict) --
An object that describes the solution.
name (string) --
The name of the solution.
solutionArn (string) --
The ARN of the solution.
performHPO (boolean) --
Whether to perform hyperparameter optimization (HPO) on the chosen recipe. The default is false .
performAutoML (boolean) --
Warning
We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see Determining your use case.
When true, Amazon Personalize performs a search for the best USER_PERSONALIZATION recipe from the list specified in the solution configuration ( recipeArn must not be specified). When false (the default), Amazon Personalize uses recipeArn for training.
performAutoTraining (boolean) --
Specifies whether the solution automatically creates solution versions. The default is True and the solution automatically creates new solution versions every 7 days.
For more information about auto training, see Creating and configuring a solution.
recipeArn (string) --
The ARN of the recipe used to create the solution. This is required when performAutoML is false.
datasetGroupArn (string) --
The Amazon Resource Name (ARN) of the dataset group that provides the training data.
eventType (string) --
The event type (for example, 'click' or 'like') that is used for training the model. If no eventType is provided, Amazon Personalize uses all interactions for training with equal weight regardless of type.
solutionConfig (dict) --
Describes the configuration properties for the solution.
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 algorithm hyperparameters and their values.
(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.
trainingDataConfig (dict) --
Specifies the training data configuration to use when creating a custom solution version (trained model).
excludedDatasetColumns (dict) --
Specifies the columns to exclude from training. Each key is a dataset type, and each value is a list of columns. Exclude columns to control what data Amazon Personalize uses to generate recommendations.
For example, you might have a column that you want to use only to filter recommendations. You can exclude this column from training and Amazon Personalize considers it only when filtering.
(string) --
(list) --
(string) --
autoTrainingConfig (dict) --
Specifies the automatic training configuration to use.
schedulingExpression (string) --
Specifies how often to automatically train new solution versions. Specify a rate expression in rate(value unit ) format. For value, specify a number between 1 and 30. For unit, specify day or days . For example, to automatically create a new solution version every 5 days, specify rate(5 days) . The default is every 7 days.
For more information about auto training, see Creating and configuring a solution.
autoMLResult (dict) --
When performAutoML is true, specifies the best recipe found.
bestRecipeArn (string) --
The Amazon Resource Name (ARN) of the best recipe.
status (string) --
The status of the solution.
A solution 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 creation date and time (in Unix time) of the solution.
lastUpdatedDateTime (datetime) --
The date and time (in Unix time) that the solution was last updated.
latestSolutionVersion (dict) --
Describes the latest version of the solution, including the status and the ARN.
solutionVersionArn (string) --
The Amazon Resource Name (ARN) of the solution version.
status (string) --
The status of the solution version.
A solution version can be in one of the following states:
CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
trainingMode (string) --
The scope of training to be performed when creating the solution version. A FULL training considers all of the data in your dataset group. An UPDATE processes only the data that has changed since the latest training. Only solution versions created with the User-Personalization recipe can use UPDATE .
trainingType (string) --
Whether the solution version was created automatically or manually.
creationDateTime (datetime) --
The date and time (in Unix time) that this version of a solution was created.
lastUpdatedDateTime (datetime) --
The date and time (in Unix time) that the solution version was last updated.
failureReason (string) --
If a solution version fails, the reason behind the failure.
{'solutionVersion': {'solutionConfig': {'autoTrainingConfig': {'schedulingExpression': 'string'}}, 'trainingMode': {'AUTOTRAIN'}, 'trainingType': 'AUTOMATIC | MANUAL'}}
Describes a specific version of a solution. For more information on solutions, see CreateSolution
See also: AWS API Documentation
Request Syntax
client.describe_solution_version( solutionVersionArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the solution version.
dict
Response Syntax
{ 'solutionVersion': { 'name': 'string', 'solutionVersionArn': 'string', 'solutionArn': 'string', 'performHPO': True|False, 'performAutoML': True|False, 'recipeArn': 'string', 'eventType': 'string', 'datasetGroupArn': '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' }, 'trainingDataConfig': { 'excludedDatasetColumns': { 'string': [ 'string', ] } }, 'autoTrainingConfig': { 'schedulingExpression': 'string' } }, 'trainingHours': 123.0, 'trainingMode': 'FULL'|'UPDATE'|'AUTOTRAIN', 'tunedHPOParams': { 'algorithmHyperParameters': { 'string': 'string' } }, 'status': 'string', 'failureReason': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'trainingType': 'AUTOMATIC'|'MANUAL' } }
Response Structure
(dict) --
solutionVersion (dict) --
The solution version.
name (string) --
The name of the solution version.
solutionVersionArn (string) --
The ARN of the solution version.
solutionArn (string) --
The ARN of the solution.
performHPO (boolean) --
Whether to perform hyperparameter optimization (HPO) on the chosen recipe. The default is false .
performAutoML (boolean) --
When true, Amazon Personalize searches for the most optimal recipe according to the solution configuration. When false (the default), Amazon Personalize uses recipeArn .
recipeArn (string) --
The ARN of the recipe used in the solution.
eventType (string) --
The event type (for example, 'click' or 'like') that is used for training the model.
datasetGroupArn (string) --
The Amazon Resource Name (ARN) of the dataset group providing the training data.
solutionConfig (dict) --
Describes the configuration properties for the solution.
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 algorithm hyperparameters and their values.
(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.
trainingDataConfig (dict) --
Specifies the training data configuration to use when creating a custom solution version (trained model).
excludedDatasetColumns (dict) --
Specifies the columns to exclude from training. Each key is a dataset type, and each value is a list of columns. Exclude columns to control what data Amazon Personalize uses to generate recommendations.
For example, you might have a column that you want to use only to filter recommendations. You can exclude this column from training and Amazon Personalize considers it only when filtering.
(string) --
(list) --
(string) --
autoTrainingConfig (dict) --
Specifies the automatic training configuration to use.
schedulingExpression (string) --
Specifies how often to automatically train new solution versions. Specify a rate expression in rate(value unit ) format. For value, specify a number between 1 and 30. For unit, specify day or days . For example, to automatically create a new solution version every 5 days, specify rate(5 days) . The default is every 7 days.
For more information about auto training, see Creating and configuring a solution.
trainingHours (float) --
The time used to train the model. You are billed for the time it takes to train a model. This field is visible only after Amazon Personalize successfully trains a model.
trainingMode (string) --
The scope of training to be performed when creating the solution version. A FULL training considers all of the data in your dataset group. An UPDATE processes only the data that has changed since the latest training. Only solution versions created with the User-Personalization recipe can use UPDATE .
tunedHPOParams (dict) --
If hyperparameter optimization was performed, contains the hyperparameter values of the best performing model.
algorithmHyperParameters (dict) --
A list of the hyperparameter values of the best performing model.
(string) --
(string) --
status (string) --
The status of the solution version.
A solution version can be in one of the following states:
CREATE PENDING
CREATE IN_PROGRESS
ACTIVE
CREATE FAILED
CREATE STOPPING
CREATE STOPPED
failureReason (string) --
If training a solution version fails, the reason for the failure.
creationDateTime (datetime) --
The date and time (in Unix time) that this version of the solution was created.
lastUpdatedDateTime (datetime) --
The date and time (in Unix time) that the solution was last updated.
trainingType (string) --
Whether the solution version was created automatically or manually.
{'solutionVersions': {'trainingMode': 'FULL | UPDATE | AUTOTRAIN', 'trainingType': 'AUTOMATIC | MANUAL'}}
Returns a list of solution versions for the given solution. When a solution is not specified, all the solution versions associated with the account are listed. The response provides the properties for each solution version, including the Amazon Resource Name (ARN).
See also: AWS API Documentation
Request Syntax
client.list_solution_versions( solutionArn='string', nextToken='string', maxResults=123 )
string
The Amazon Resource Name (ARN) of the solution.
string
A token returned from the previous call to ListSolutionVersions for getting the next set of solution versions (if they exist).
integer
The maximum number of solution versions to return.
dict
Response Syntax
{ 'solutionVersions': [ { 'solutionVersionArn': 'string', 'status': 'string', 'trainingMode': 'FULL'|'UPDATE'|'AUTOTRAIN', 'trainingType': 'AUTOMATIC'|'MANUAL', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'failureReason': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
solutionVersions (list) --
A list of solution versions describing the version properties.
(dict) --
Provides a summary of the properties of a solution version. For a complete listing, call the DescribeSolutionVersion API.
solutionVersionArn (string) --
The Amazon Resource Name (ARN) of the solution version.
status (string) --
The status of the solution version.
A solution version can be in one of the following states:
CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
trainingMode (string) --
The scope of training to be performed when creating the solution version. A FULL training considers all of the data in your dataset group. An UPDATE processes only the data that has changed since the latest training. Only solution versions created with the User-Personalization recipe can use UPDATE .
trainingType (string) --
Whether the solution version was created automatically or manually.
creationDateTime (datetime) --
The date and time (in Unix time) that this version of a solution was created.
lastUpdatedDateTime (datetime) --
The date and time (in Unix time) that the solution version was last updated.
failureReason (string) --
If a solution version fails, the reason behind the failure.
nextToken (string) --
A token for getting the next set of solution versions (if they exist).
{'campaignConfig': {'syncWithLatestSolutionVersion': 'boolean'}}
Updates a campaign to deploy a retrained solution version with an existing campaign, change your campaign's minProvisionedTPS , or modify your campaign's configuration. For example, you can set enableMetadataWithRecommendations to true for an existing campaign.
To update a campaign to start automatically using the latest solution version, specify the following:
For the SolutionVersionArn parameter, specify the Amazon Resource Name (ARN) of your solution in SolutionArn/$LATEST format.
In the campaignConfig , set syncWithLatestSolutionVersion to true .
To update a campaign, the campaign status must be ACTIVE or CREATE FAILED. Check the campaign status using the DescribeCampaign operation.
Note
You can still get recommendations from a campaign while an update is in progress. The campaign will use the previous solution version and campaign configuration to generate recommendations until the latest campaign update status is Active .
For more information about updating a campaign, including code samples, see Updating a campaign. For more information about campaigns, see Creating a campaign.
See also: AWS API Documentation
Request Syntax
client.update_campaign( campaignArn='string', solutionVersionArn='string', minProvisionedTPS=123, campaignConfig={ 'itemExplorationConfig': { 'string': 'string' }, 'enableMetadataWithRecommendations': True|False, 'syncWithLatestSolutionVersion': True|False } )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the campaign.
string
The Amazon Resource Name (ARN) of a new model to deploy. To specify the latest solution version of your solution, specify the ARN of your solution in SolutionArn/$LATEST format. You must use this format if you set syncWithLatestSolutionVersion to True in the CampaignConfig.
To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.
For more information about automatic campaign updates, see Enabling automatic campaign updates.
integer
Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high minProvisionedTPS will increase your bill. We recommend starting with 1 for minProvisionedTPS (the default). Track your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS as necessary.
dict
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) --
enableMetadataWithRecommendations (boolean) --
Whether metadata with recommendations is enabled for the campaign. If enabled, you can specify the columns from your Items dataset in your request for recommendations. Amazon Personalize returns this data for each item in the recommendation response. For information about enabling metadata for a campaign, see Enabling metadata in recommendations for a campaign.
If you enable metadata in recommendations, you will incur additional costs. For more information, see Amazon Personalize pricing.
syncWithLatestSolutionVersion (boolean) --
Whether the campaign automatically updates to use the latest solution version (trained model) of a solution. If you specify True , you must specify the ARN of your solution for the SolutionVersionArn parameter. It must be in SolutionArn/$LATEST format. The default is False and you must manually update the campaign to deploy the latest solution version.
For more information about automatic campaign updates, see Enabling automatic campaign updates.
dict
Response Syntax
{ 'campaignArn': 'string' }
Response Structure
(dict) --
campaignArn (string) --
The same campaign ARN as given in the request.