Amazon Personalize
Developer Guide

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

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 algorithms, see Creating an Algorithm. For more information on hyperparameters, see Hyperparameter Optimization.

Feature transformation is the process of modifying raw input data into a form more suitable for model training. For example, a categorical field of strings could be modified by assigning a unique number to each category. The modified data would then be used as input for the model training. For more information, see Feature Transformation.

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. If your business has more specific needs, Amazon Personalize allows you to "Bring Your Own Recipe" (BYOR). For more information, see Bring Your Own Recipe.

Creating a Solution

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

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

How a recipe is chosen is shown in the following table. Either performAutoML or recipeArn should be specified but not both.

performAutoML recipeArn solutionConfig Result
true omit omitted Amazon Personalize chooses the recipe
true omit autoMLConfig: metricName and recipeList specified (other solutionConfig properties ignored) Amazon Personalize chooses a recipe from the list to optimize 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. This list can include both predefined and BYOR recipes. 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.

Bring Your Own Recipe

If you want to use your own algorithm, Amazon Personalize offers its "Bring Your Own Recipe" feature. Your algorithm will be part of the same data pipelines, training APIs, and recommendations as Amazon Personalize's predefined algorithms. You can run metrics and benchmark your algorithms against Amazon Personalize's algorithms in order to choose the most appropriate model for your needs. For more information see Bring Your Own Recipe.

Customize the Training

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

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)

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

  2. Use the following code to create the solution.

    import boto3 import io if __name__ == "__main__": personalize = boto3.client('personalize', region_name='us-west-2') response=personalize.create_solution( datasetGroupArn="dataset group arn", name="solution name", performAutoML=True, minTPS=10) print ("Solution ARN: " + response['solutionArn'])

On this page: