Creating a campaign
For real-time recommendations with custom resources, after you complete Creating a solution version, you are ready to deploy your solution version with a campaign.
A campaign deploys a solution version (trained model) with a provisioned transaction capacity for generating real-time recommendations. After you create a campaign, you use the GetRecommendations or GetPersonalizedRanking API operations to get recommendations. If you are getting batch recommendations, you don't need to create a campaign. For more information see Batch recommendations and user segments (custom resources).
You create a campaign with the Amazon Personalize console, Amazon Command Line Interface (Amazon CLI), or Amazon SDKs.
Important
If you manually retrain your solution version or want to change your campaign settings, you must update your campaign. For more information see Updating a campaign.
Topics
Minimum provisioned transactions per second and auto-scaling
Important
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.
When you create an Amazon Personalize campaign, you specify a provisioned transaction capacity for generating recommendations. 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 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.
Creating a campaign (console)
After your solution version status is Active you are ready to deploy it with an Amazon Personalize campaign.
To create a campaign (console)
-
Open the Amazon Personalize console at https://console.amazonaws.cn/personalize/home
and sign into your account. -
Choose the dataset group with the solution version you want to deploy.
-
In the navigation pane, choose Campaigns.
-
On the Campaigns page, choose Create campaign.
-
On the Create new campaign page, for Campaign details, provide the following information:
-
Campaign name: Enter the name of the campaign. The text you enter here appears on the Campaign dashboard and details page.
-
Solution: Choose the solution that you just created.
-
Solution version ID: Choose the ID of the solution version that you just created.
-
Minimum provisioned transactions per second (called minProvisionedTPS in APIs): Set the minimum provisioned transactions per second that Amazon Personalize supports. A high value will increase your bill. We recommend starting with 1 (the default). Track your usage using Amazon CloudWatch metrics, and increase the
minProvisionedTPS
as necessary. For more information, see Minimum provisioned transactions per second and auto-scaling.
-
-
If you used the User-Personalization recipe, in Campaign configuration optionally enter values for the Exploration weight and Exploration item age cut off. For more information see User-Personalization.
-
For Tags, optionally add any tags. For more information about tagging Amazon Personalize resources, see Tagging Amazon Personalize resources.
-
Choose Create campaign.
-
On the campaign details page, when the campaign status is Active, you can use the campaign to get recommendations and record impressions. For more information, see Step 4: Getting recommendations.
The campaign is ready when its status is ACTIVE. If you retrain your solution version or want to change your campaign settings, you must update your campaign. For more information see Updating a campaign.
Creating a campaign (Amazon CLI)
After your solution version status is Active, you are ready to deploy it with an Amazon Personalize campaign.
Use the following create-campaign
Amazon CLI command to create a campaign that deploys a solution version trained using the User-Personalization recipe.
Give the campaign a name and specify the solution version ARN (Amazon Resource Name). Optionally change the minProvisionedTPS
if your use case requires a higher provisioned capacity. The minimum value is 1.
The campaign-config
parameters are specific to the recipe that you used to train the solution
version (for more information about recipes see Choosing a
recipe).
The example uses the following User-Personalization recipe specific itemExplorationConfig
fields with their default values: explorationWeight
and explorationItemAgeCutOff
.
If you omit the campaign-config
parameter, the default values apply. For more information about the itemExplorationConfig
fields, see
the Properties and hyperparameters for the
User-Personalization recipe.
aws personalize create-campaign \ --name
campaign name
\ --solution-version-arnsolution version arn
\ --min-provisioned-tps1
\ --campaign-config "{\"itemExplorationConfig\":{\"explorationWeight\":\"0.3\",\"explorationItemAgeCutOff\":\"30\"}}"
The campaign is ready when its status is ACTIVE. To get the current status,
call DescribeCampaign and
check that the status
field is ACTIVE
.
If you retrain your solution version or want to change your campaign settings, you must update your campaign. For more information see Updating a campaign.
Amazon Personalize provides operations for managing campaigns such as ListCampaigns to list the campaigns you have created. You can delete a campaign by calling DeleteCampaign. If you delete a campaign, the solution versions that are part of the campaign are not deleted.
After you have created your campaign, use it to make recommendations. For more information, see Step 4: Getting recommendations.
Creating a campaign (Amazon SDKs)
After your solution version status is Active you are ready to deploy it with an Amazon Personalize campaign. Use the following code to create a campaign. Give the campaign a name,
specify the Amazon Resource Name (ARN) of the solution version to deploy, and optionally specify
the Minimum provisioned TPS the campaign will support (the default value for this parameter is 1).
If you use the User-Personalization recipe, you can configure
item exploration with the itemExplorationWeight
and explorationItemAgeCutOff
parameters.
The campaign is ready when its status is ACTIVE. To get the current status,
call DescribeCampaign and
check that the status
field is ACTIVE
.
If you manually retrain your solution version or want to change your campaign settings, you must update your campaign. For more information see Updating a campaign.
Amazon Personalize provides operations for managing campaigns such as ListCampaigns to list the campaigns you have created. You can delete a campaign by calling DeleteCampaign. If you delete a campaign, the solution versions that are part of the campaign are not deleted.
After you have created your campaign, use it to make recommendations. For more information, see Step 4: Getting recommendations.