Step 3: Creating a Solution Version
Once you have completed Step 1: Choosing a Recipe and Step 2: Configuring a Solution, you are ready to create a Solution Version.
A Solution Version refers to a trained machine learning model you can deploy to get recommendations for customers. You can create a solution version using the console, AWS Command Line Interface (AWS CLI), or AWS SDK.
Topics
Creating a Solution Version (Console)
If you just completed Step 2: Configuring a Solution and the Create solution version is displayed, choose FINISH to create a solution version.
On the solution details page, you can track training progress in the Solution versions section. When training is complete, the status is Active and you are ready to deploy a campaign and get recommendations. See step 3 in the Getting Started (Console) tutorial.
If you navigated away from the Create solution version page or want to create an additional solution version for an existing solution, create a new solution version from the solution overview page as follows.
Create a new solution version
-
Open the Amazon Personalize console at https://console.aws.amazon.com/personalize/
and sign into your account. -
Navigate to the dataset groups page and choose the dataset group with your new solution.
-
In the navigation pane, choose Solutions and recipes.
-
Choose the solution. The solution overview page displays.
-
Choose Create solution version to start training a new model.
On the solution details page, you can track training progress in the Solution versions section. When training is complete, the status is Active and you are ready to deploy a campaign and get recommendations. See step 3 in the Getting Started (Console) tutorial.
Creating a Solution Version (AWS CLI)
When your solution is ACTIVE, train the model by running the following
command. Replace solution arn
with the solution Amazon Resource Name (ARN) from Step 2: Configuring a Solution.
aws personalize create-solution-version \ --solution-arn
solution arn
The solution version ARN is displayed, for example:
{ "solutionVersionArn": "arn:aws:personalize:us-west-2:acct-id:solution/SolutionName/<version-id>" }
Check the training status of the solution version by using the
describe-solution-version
command. Provide the solution version ARN that
was returned in the previous step. For more information about the API, see DescribeSolutionVersion.
aws personalize describe-solution-version \ --solution-version-arn
solution version arn
The properties of the solution version and the training status
are
displayed. Initially, the status shows as CREATE PENDING, for example:
{ "solutionVersion": { "solutionVersionArn": "arn:aws:personalize:us-west-2:acct-id:solution/solutionName/<version-id>", ..., "status": "CREATE PENDING" } }
Training is complete when the status
is ACTIVE
.
Now that you have created a solution version, evaluate it using metrics supplied by Amazon Personalize. For more information, see Step 4: Evaluating a Solution Version.
Creating a Solution Version (AWS Python SDK)
When your solution is ACTIVE, Create a solution version using the create_solution
method.
Replace the solution arn
with the Amazon Resource Name (ARN) of the solution from
Step 2: Configuring a Solution.
import boto3 personalize = boto3.client('personalize') # Store the solution ARN solution_arn = '
solution arn
' # 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 create a solution version. print ('Creating solution version') response = personalize.create_solution_version(solutionArn = solution_arn) solution_version_arn = response['solutionVersionArn'] print('Solution version ARN: ' + solution_version_arn) # 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'])
To check the current solution version status, call the DescribeSolutionVersion operation
and pass the ARN of the solution version returned from the CreateSolutionVersion
operation. Training is complete when the status
is ACTIVE
.
Now that you have a created solution version, evaluate it using metrics supplied by Amazon Personalize. For more information, see Step 4: Evaluating a Solution Version.