CreateSolution
Creates the configuration for training a model. A trained model is known as
a solution version. After the configuration is created, you train the model (create a solution version)
by calling the CreateSolutionVersion operation. Every time you call
CreateSolutionVersion
, a new version of the solution is created.
After creating a solution version, you check its accuracy by calling GetSolutionMetrics. When you are satisfied with the version, you deploy it using CreateCampaign. The campaign provides recommendations to a client through the GetRecommendations API.
To train a model, Amazon Personalize requires training data and a recipe. The training data comes from the dataset group that you provide in the request. A recipe specifies the training algorithm and a feature transformation. You can specify one of the predefined recipes provided by Amazon Personalize.
Note
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 DescribeSolution. Wait
until the status shows as ACTIVE before calling CreateSolutionVersion
.
Related APIs
Request Syntax
{
"datasetGroupArn": "string
",
"eventType": "string
",
"name": "string
",
"performAutoML": boolean
,
"performHPO": boolean
,
"recipeArn": "string
",
"solutionConfig": {
"algorithmHyperParameters": {
"string
" : "string
"
},
"autoMLConfig": {
"metricName": "string
",
"recipeList": [ "string
" ]
},
"eventValueThreshold": "string
",
"featureTransformationParameters": {
"string
" : "string
"
},
"hpoConfig": {
"algorithmHyperParameterRanges": {
"categoricalHyperParameterRanges": [
{
"name": "string
",
"values": [ "string
" ]
}
],
"continuousHyperParameterRanges": [
{
"maxValue": number
,
"minValue": number
,
"name": "string
"
}
],
"integerHyperParameterRanges": [
{
"maxValue": number
,
"minValue": number
,
"name": "string
"
}
]
},
"hpoObjective": {
"metricName": "string
",
"metricRegex": "string
",
"type": "string
"
},
"hpoResourceConfig": {
"maxNumberOfTrainingJobs": "string
",
"maxParallelTrainingJobs": "string
"
}
},
"optimizationObjective": {
"itemAttribute": "string
",
"objectiveSensitivity": "string
"
},
"trainingDataConfig": {
"excludedDatasetColumns": {
"string
" : [ "string
" ]
}
}
},
"tags": [
{
"tagKey": "string
",
"tagValue": "string
"
}
]
}
Request Parameters
The request accepts the following data in JSON format.
- datasetGroupArn
-
The Amazon Resource Name (ARN) of the dataset group that provides the training data.
Type: String
Length Constraints: Maximum length of 256.
Pattern:
arn:([a-z\d-]+):personalize:.*:.*:.+
Required: Yes
- 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.Type: String
Length Constraints: Maximum length of 256.
Required: No
- name
-
The name for the solution.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 63.
Pattern:
^[a-zA-Z0-9][a-zA-Z0-9\-_]*
Required: Yes
- performAutoML
-
Important
We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see Determining your use case.
Whether to perform automated machine learning (AutoML). The default is
false
. For this case, you must specifyrecipeArn
.When set to
true
, Amazon Personalize analyzes your training data and selects the optimal USER_PERSONALIZATION recipe and hyperparameters. In this case, you must omitrecipeArn
. 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.Type: Boolean
Required: No
- 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 tofalse
.Type: Boolean
Required: No
- recipeArn
-
The ARN of the recipe to use for model training. This is required when
performAutoML
is false.Type: String
Length Constraints: Maximum length of 256.
Pattern:
arn:([a-z\d-]+):personalize:.*:.*:.+
Required: No
- solutionConfig
-
The configuration to use with the solution. When
performAutoML
is set to true, Amazon Personalize only evaluates theautoMLConfig
section of the solution configuration.Note
Amazon Personalize doesn't support configuring the
hpoObjective
at this time.Type: SolutionConfig object
Required: No
-
A list of tags to apply to the solution.
Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
Required: No
Response Syntax
{
"solutionArn": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- solutionArn
-
The ARN of the solution.
Type: String
Length Constraints: Maximum length of 256.
Pattern:
arn:([a-z\d-]+):personalize:.*:.*:.+
Errors
- InvalidInputException
-
Provide a valid value for the field or parameter.
HTTP Status Code: 400
- LimitExceededException
-
The limit on the number of requests per second has been exceeded.
HTTP Status Code: 400
- ResourceAlreadyExistsException
-
The specified resource already exists.
HTTP Status Code: 400
- ResourceInUseException
-
The specified resource is in use.
HTTP Status Code: 400
- ResourceNotFoundException
-
Could not find the specified resource.
HTTP Status Code: 400
- TooManyTagsException
-
You have exceeded the maximum number of tags you can apply to this resource.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: