Creating and configuring a solution - Amazon Personalize
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating and configuring a solution

After you finish importing data, you are ready to create a solution. A solution refers to the combination of an Amazon Personalize recipe, customized parameters, and one or more solution versions (trained models).

When you create a solution, you can configure it to meet your specific business needs:

If you have an existing solution, you can use the Amazon Personalize console to clone the solution. When you clone a solution, you can use the configuration of the existing solution as a starting point, such as the recipe and hyperparameters, and make any changes as necessary. For more information, see Cloning a solution (console). After you create a solution, you can view the solution's configuration details on the solution's details page of the Amazon Personalize console, or with the DescribeSolution operation.

You can create and configure a solution using the console, Amazon Command Line Interface (Amazon CLI), or Amazon SDK.

Creating a solution (console)

To create a solution in the console, choose the dataset group containing the dataset you'll be using, and then specify a solution name, recipe, and optional recipe specific hyperparameters.

If your recipe generates item recommendations or user segments, you can change the columns to experiment with different combinations of training data, or exclude columns without meaningful data from training. For example, 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.

To configure a solution (console)
  1. Open the Amazon Personalize console at https://console.amazonaws.cn/personalize/home and sign in to your account.

  2. On the Dataset groups page, choose your dataset group.

  3. On the Overview page, for Step 3:

    • If you created a Domain dataset group, choose Use custom resources and choose Create solutions.

    • If you created a Custom dataset group, choose Create solutions.

  4. For Solution name, specify a name for your solution.

  5. For Solution type, choose the type of solution you want to create. The type you choose determines what recipes are available.

    • Choose Item recommendation to get item recommendations for your users. For example, personalized movie recommendations.

    • Choose Action recommendation to get action recommendations for your users. For example, generate the next best action, like download your app, for a user.

    • Choose User segmentation to get user segments (groups of users) based on your item data.

  6. For Recipe, choose a recipe (see Choosing a recipe).

  7. For Tags, optionally add any tags. For more information about tagging Amazon Personalize resources, see Tagging Amazon Personalize resources.

  8. Choose Next.

  9. On the Advanced configuration page, if your recipe generates item recommendations or user segments, optionally use Columns for training to choose the columns Amazon Personalize considers when training solution versions.

    By default, Amazon Personalize uses all columns that can be used in training. Only datasets used by your chosen recipe are listed. Columns with the boolean data type and non-categorical string fields aren't used. You can't exclude EVENT_TYPE columns.

    For more information, see Configuring columns used when training.

  10. In Hyperparameter configuration, configure any hyperparameter options based on your recipe and business needs. Different recipes use different hyperparameters. For the available hyperparameters, see the individual recipes in Choosing a recipe.

  11. In Solution configuration, if your Item interactions dataset has EVENT_TYPE or both EVENT_TYPE and EVENT_VALUE columns, optionally use the Event type and Event value threshold fields to choose the item interactions data that Amazon Personalize uses when training the model.

    For more information see Choosing the item interaction data used for training.

  12. If you use either the User-Personalization recipe or Personalized-Ranking recipe recipe, optionally specify an Objective and choose an Objective sensitivity to optimize your solution for an objective in addition to relevance. The objective sensitivity configures how Amazon Personalize balances recommending items based on your objective versus relevance through interactions data. For more information see Optimizing a solution for an additional objective.

  13. Choose Next and review the solution details. You can't change your solution's configuration after you create it.

  14. Choose Create solution. Amazon Personalize starts creating your first solution version and the Solutions and recipes page appears. To monitor its status, choose your solution and view the status in the Solution versions section.

    When it's active, you are ready to deploy it in a campaign and then get real-time recommendations. Or, depending on your recipe, you can get batch recommendations without creating a campaign.

    For information about campaigns, see Creating a campaign. For information about batch recommendations, see Batch recommendations and user segments (custom resources).

Creating a solution (Amazon CLI)

To create a solution using the Amazon CLI, use the following create-solution operation. Specify the solution name, dataset group arn, and recipe arn.

aws personalize create-solution \ --name solution name \ --dataset-group-arn dataset group arn \ --recipe-arn recipe arn

The solution Amazon Resource Name (ARN) is displayed, for example:

{ "solutionArn": "arn:aws:personalize:<region>:solution/<solution name>" }

Record the solution ARN for future use and proceed to Creating a solution version (Amazon CLI).

Depending on your recipe, you can modify the above code to optimize recipe properties and hyperparameters (see Hyperparameters and HPO), choose columns used in training (see Configuring columns used when training (Amazon CLI)), or filter the Interactions data used for training (see Choosing the item interaction data used for training).

If you use either the User-Personalization recipe or Personalized-Ranking recipe recipe, you can optimize your solution for an objective in addition to relevance. For more information see Optimizing a solution for an additional objective.

Creating a solution (Amazon SDKs)

The following code shows how to create an Amazon Personalize solution. Give the solution a name, and specify the Amazon Resource Name (ARN) of your dataset group, and the ARN of the recipe to use. For information on recipes, see Choosing a recipe.

Depending on your recipe, you can modify the following code to optimize recipe properties and hyperparameters (see Hyperparameters and HPO), configure what columns are used for training (see Configuring columns used when training (Amazon SDKs)), or filter the Interactions data used for training (see Choosing the item interaction data used for training).

If you use either the User-Personalization recipe or Personalized-Ranking recipe recipe, you can optimize your solution for an objective in addition to relevance. For more information see Optimizing a solution for an additional objective.

SDK for Python (Boto3)
import boto3 personalize = boto3.client('personalize') print('Creating solution') create_solution_response = personalize.create_solution( name='solution name', recipeArn= 'recipe arn', datasetGroupArn = 'dataset group arn' ) solution_arn = create_solution_response['solutionArn'] print('solution_arn: ', solution_arn)
SDK for Java 2.x
public static String createPersonalizeSolution(PersonalizeClient personalizeClient, String datasetGroupArn, String solutionName, String recipeArn) { try { CreateSolutionRequest solutionRequest = CreateSolutionRequest.builder() .name(solutionName) .datasetGroupArn(datasetGroupArn) .recipeArn(recipeArn) .build(); CreateSolutionResponse solutionResponse = personalizeClient.createSolution(solutionRequest); return solutionResponse.solutionArn(); } catch (PersonalizeException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } return ""; }
SDK for JavaScript v3
// Get service clients module and commands using ES6 syntax. import { CreateSolutionCommand } from "@aws-sdk/client-personalize"; import { personalizeClient } from "./libs/personalizeClients.js"; // Or, create the client here. // const personalizeClient = new PersonalizeClient({ region: "REGION"}); // Set the solution parameters. export const createSolutionParam = { datasetGroupArn: 'DATASET_GROUP_ARN', /* required */ recipeArn: 'RECIPE_ARN', /* required */ name: 'NAME' /* required */ } export const run = async () => { try { const response = await personalizeClient.send(new CreateSolutionCommand(createSolutionParam)); console.log("Success", response); return response; // For unit tests. } catch (err) { console.log("Error", err); } }; run();

Record the solution ARN for future use and proceed to Creating a solution version (Amazon SDKs).