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 Solution

A solution is the term Amazon Personalize uses for a trained machine learning model that makes recommendations to customers. Creating a solution entails optimizing the model to deliver the best results for a specific business need. Amazon Personalize uses "recipes" to create these personalized solutions.

A recipe in Amazon Personalize is made up of an algorithm with hyperparameters, and a feature transformation. An algorithm is a mathematical expression that when trained becomes the model. The algorithm contains parameters whose unknown values are determined by training on input data. Hyperparameters are external to the algorithm and specify details of the training process, such as the number of training passes to run over the complete dataset or the number of hidden layers to use. For more information on hyperparameters, see Hyperparameter Optimization.

Amazon Personalize provides a number of predefined recipes that allow you to make recommendations with no knowledge of machine learning. The predefined recipes are also useful for quick experimentation. For more information, see Using Predefined Recipes.

Creating a Solution

A solution is created by calling the CreateSolution and CreateSolutionVersion operations. A condensed, reorganized version of the CreateSolution request is shown. The various options and configuration objects are discussed in the following sections.

{ "name": "string", "datasetGroupArn": "string", "performAutoML": boolean, "recipeArn": "string", "minProvisionedTPS": number, "performHPO": boolean, "eventType": "string", "solutionConfig": { "autoMLConfig": { "metricName": "string", "recipeList": [ "string" ] }, "eventValueThreshold": "string", "algorithmHyperParameters": { }, "featureTransformationParameters": { }, "hpoConfig": { } }, }

How a recipe is chosen is shown in the following table. Either performAutoML or recipeArn must be specified but not both. When performAutoML is true, all parameters of the solutionConfig object are ignored except for autoMLConfig. AutoML is only performed using the HRNN recipes.

performAutoML recipeArn solutionConfig Result
true omit omitted Amazon Personalize chooses the recipe
true omit autoMLConfig: metricName and recipeList specified Amazon Personalize chooses a recipe from the list that optimizes the metric
omit specified omitted You specify the recipe
omit specified specified You specify the recipe and override the training properties

Leave it to Amazon Personalize

If you have no knowledge of machine learning, or just want to get started as quickly as possible, you can have Amazon Personalize analyze your data and decide on the best predefined recipe and options to use. In this case, you call CreateSolution, specify 'true' for the performAutoML parameter, and omit the recipeArn and solutionConfig parameters. Amazon Personalize does the rest.

You can also specify the list of recipes that Amazon Personalize examines to determine the optimal recipe, based on a metric you specify. In this case, you call CreateSolution, specify 'true' for the performAutoML parameter, omit the recipeArn parameter, and include the solutionConfig parameter, specifying the metricName and recipeList as part of the autoMLConfig object.

Instead of having Amazon Personalize choosing the recipe, you can do so manually. In this case, you call CreateSolution, specify 'false' for performAutoML, and supply the recipeArn parameter. For the list of predefined recipes, see Using Predefined Recipes.

Customize the Training

To customize the training, supply the solutionConfig parameter. The SolutionConfig object allows you to override the default solution and recipe parameters. For more information see Overriding Default Recipe Parameters.

Evaluate the Training

After training a model, you evaluate it to determine whether its performance and accuracy allow you to achieve your business goals. You might generate multiple models using different methods and evaluate each. For example, you could apply different business rules for each model, and then apply various measures to determine each model's suitability. For more information, see Evaluating Solutions.

To create a solution (SDK)

Create a solution by using the AWS Python SDK

  1. Create and import a dataset into a dataset group. For more information, see Preparing and Importing Data.

  2. Create the solution using the dataset group and the following code.

    import boto3 personalize = boto3.client('personalize') print ('Creating solution') response=personalize.create_solution( name="Solution name", datasetGroupArn="Dataset group arn", performAutoML=True) # Get the solution ARN. solution_arn=response['solutionArn'] print('Solution ARN: ' + solutionArn) # Use the solution ARN to get the solution status. solution_description=personalize.describe_solution(solutionArn=solution_arn)['solution'] print('Solution status: ' + solution_description['status']) # Use the solution ARN to get the solution version ARN. print ('Creating solution version') response=personalize.create_solution_version(solutionArn=solution_arn) solution_version_arn=response['solutionVersionArn'] print('Solution version ARN: ' + solutionVersionArn) # Use the solution version ARN to get the solution version status. solution_version_description=personalize.describe_solution_version(solutionVersionArn=solution_version_arn)['solutionVersion'] print('Solution version status: ' + solution_version_description['status'])

Training a model takes time to complete. To check the current solution version status, call DescribeSolutionVersion and pass the ARN of the solution version returned from CreateSolutionVersion. Training is complete when the status shows as ACTIVE.

Now that you have a solution version, you can create a campaign by deploying the solution version. For more information, see Creating a Campaign.

On this page: