Amazon Personalize
Developer Guide

This is prerelease documentation for a service in preview release. It is subject to change.

We made breaking changes to the Amazon Personalize API and service model on 3/26/19. To continue using Amazon Personalize with the AWS Command Line Interface or AWS SDK for Python (Boto 3), update your service JSON files by doing steps 3-6 of Setting Up the AWS CLI.

Creating a Campaign

A campaign is used to make recommendations for your users. You create a campaign by deploying a solution. For an example using the AWS CLI, see Step 3: Create a Campaign (Deploy the Solution).

To create a campaign with the SDK, call the CreateCampaign API and pass the following:

  • A name for the campaign.

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

  • The minimum provisioned transactions (recommendations) per second that Amazon Personalize will support.

Create a campaign using the AWS Python SDK

  1. Create a solution version to deploy. For more information, see Creating a Solution.

  2. Use the following code to create a campaign.

    import boto3 personalize = boto3.client('personalize') response = personalize.create_campaign( name = 'campaign name', solutionVersionArn = 'solution version arn', minProvisionedTPS = 10 ) arn=response['campaignArn'] description = personalize.describe_campaign(campaignArn=arn)['campaign'] print('Name: ' + description['name']) print('ARN: ' + description['campaignArn']) print('Status: ' + description['status'])

The campaign isn't ready for use until its status is active. To get the current status, call DescribeCampaign and check that the status field is ACTIVE.

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 solutions that are part of the campaign are not deleted.

After you have created your campaign, your deployed solution is able to make recommendations. For more information, see Getting Recommendations.