Skip to content

Create Solution

personalize_create_solution R Documentation

By default, all new solutions use automatic training

Description

By default, all new solutions use automatic training. With automatic training, you incur training costs while your solution is active. To avoid unnecessary costs, when you are finished you can update the solution to turn off automatic training. For information about training costs, see Amazon Personalize pricing.

Creates the configuration for training a model (creating a solution version). This configuration includes the recipe to use for model training and optional training configuration, such as columns to use in training and feature transformation parameters. For more information about configuring a solution, see Creating and configuring a solution.

By default, new solutions use automatic training to create solution versions every 7 days. You can change the training frequency. Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training. For more information, see Configuring automatic training.

To turn off automatic training, set performAutoTraining to false. If you turn off automatic training, you must manually create a solution version by calling the create_solution_version operation.

After training starts, you can get the solution version's Amazon Resource Name (ARN) with the list_solution_versions API operation. To get its status, use the describe_solution_version.

After training completes you can evaluate model accuracy by calling get_solution_metrics. When you are satisfied with the solution version, you deploy it using create_campaign. The campaign provides recommendations to a client through the GetRecommendations API.

Amazon Personalize doesn't support configuring the hpoObjective for solution hyperparameter optimization at this time.

Status

A solution can be in one of the following states:

  • CREATE PENDING \ CREATE IN_PROGRESS \ ACTIVE -or- CREATE FAILED

  • DELETE PENDING \ DELETE IN_PROGRESS

To get the status of the solution, call describe_solution. If you use manual training, the status must be ACTIVE before you call create_solution_version.

Related APIs

  • update_solution

  • list_solutions

  • create_solution_version

  • describe_solution

  • delete_solution

  • list_solution_versions

  • describe_solution_version

Usage

personalize_create_solution(name, performHPO, performAutoML,
  performAutoTraining, recipeArn, datasetGroupArn, eventType,
  solutionConfig, tags)

Arguments

name

[required] The name for the solution.

performHPO

Whether to perform hyperparameter optimization (HPO) on the specified or selected recipe. The default is false.

When performing AutoML, this parameter is always true and you should not set it to false.

performAutoML

We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see Choosing a recipe.

Whether to perform automated machine learning (AutoML). The default is false. For this case, you must specify recipeArn.

When set to true, Amazon Personalize analyzes your training data and selects the optimal USER_PERSONALIZATION recipe and hyperparameters. In this case, you must omit recipeArn. Amazon Personalize determines the optimal recipe by running tests with different values for the hyperparameters. AutoML lengthens the training process as compared to selecting a specific recipe.

performAutoTraining

Whether the solution uses automatic training to create new solution versions (trained models). The default is True and the solution automatically creates new solution versions every 7 days. You can change the training frequency by specifying a schedulingExpression in the AutoTrainingConfig as part of solution configuration. For more information about automatic training, see Configuring automatic training.

Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training.

After training starts, you can get the solution version's Amazon Resource Name (ARN) with the list_solution_versions API operation. To get its status, use the describe_solution_version.

recipeArn

The Amazon Resource Name (ARN) of the recipe to use for model training. This is required when performAutoML is false. For information about different Amazon Personalize recipes and their ARNs, see Choosing a recipe.

datasetGroupArn

[required] The Amazon Resource Name (ARN) of the dataset group that provides the training data.

eventType

When your have multiple event types (using an EVENT_TYPE schema field), this parameter specifies which event type (for example, 'click' or 'like') is used for training the model.

If you do not provide an eventType, Amazon Personalize will use all interactions for training with equal weight regardless of type.

solutionConfig

The configuration properties for the solution. When performAutoML is set to true, Amazon Personalize only evaluates the autoMLConfig section of the solution configuration.

Amazon Personalize doesn't support configuring the hpoObjective at this time.

tags

A list of tags to apply to the solution.

Value

A list with the following syntax:

list(
  solutionArn = "string"
)

Request syntax

svc$create_solution(
  name = "string",
  performHPO = TRUE|FALSE,
  performAutoML = TRUE|FALSE,
  performAutoTraining = TRUE|FALSE,
  recipeArn = "string",
  datasetGroupArn = "string",
  eventType = "string",
  solutionConfig = list(
    eventValueThreshold = "string",
    hpoConfig = list(
      hpoObjective = list(
        type = "string",
        metricName = "string",
        metricRegex = "string"
      ),
      hpoResourceConfig = list(
        maxNumberOfTrainingJobs = "string",
        maxParallelTrainingJobs = "string"
      ),
      algorithmHyperParameterRanges = list(
        integerHyperParameterRanges = list(
          list(
            name = "string",
            minValue = 123,
            maxValue = 123
          )
        ),
        continuousHyperParameterRanges = list(
          list(
            name = "string",
            minValue = 123.0,
            maxValue = 123.0
          )
        ),
        categoricalHyperParameterRanges = list(
          list(
            name = "string",
            values = list(
              "string"
            )
          )
        )
      )
    ),
    algorithmHyperParameters = list(
      "string"
    ),
    featureTransformationParameters = list(
      "string"
    ),
    autoMLConfig = list(
      metricName = "string",
      recipeList = list(
        "string"
      )
    ),
    optimizationObjective = list(
      itemAttribute = "string",
      objectiveSensitivity = "LOW"|"MEDIUM"|"HIGH"|"OFF"
    ),
    trainingDataConfig = list(
      excludedDatasetColumns = list(
        list(
          "string"
        )
      )
    ),
    autoTrainingConfig = list(
      schedulingExpression = "string"
    )
  ),
  tags = list(
    list(
      tagKey = "string",
      tagValue = "string"
    )
  )
)