- Newest
- Most votes
- Most comments
In Amazon Personalize, the automatic training feature is managed through the solution's settings and is not directly configurable through the CfnSolution
resource in CDK. To control the training behavior, you typically need to manage it through the solution version creation process or use the Personalize console or API.
To disable automatic training or change the training frequency, you should:
- Use the
create_solution_version
API or equivalent in CDK to specify the training parameters when creating a solution version, rather than modifying theCfnSolution
directly. - If using the console, you can configure these settings when you create or update the solution version.
Automatic training is tied to how Personalize manages solutions and versions, and adjusting the training days would be handled through these versioning processes, not directly through CfnSolution
.
In AWS Personalize, when you create a solution using the AWS CDK, automatic training is typically enabled by default. However, you can control the frequency of retraining by adjusting the performAutoML and performHPO parameters or by using the solutionVersion and campaign settings instead of relying on automatic retraining.
Step 1: Modify the Training Schedule To disable automatic training or to change the training schedule, you can use the solutionVersion resource in CDK to create a specific version of the solution manually, instead of relying on automatic updates.
Step 2: Create the Solution with a Custom Schedule The AWS Personalize CDK constructs do not directly expose a parameter to disable automatic training, but you can manage the retraining schedule by creating solutionVersion resources manually whenever you need to update the model
import aws_cdk as cdk
from aws_cdk import (
aws_personalize as personalize,
core,
)
class PersonalizeStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
# Create the solution
solution = personalize.CfnSolution(
self,
"PersonalizeRankingSolution",
dataset_group_arn="some_dataset_group_arn",
name="ranking-solution",
recipe_arn="arn:aws:personalize:::recipe/aws-personalized-ranking-v2",
perform_auto_ml=False, # Disable AutoML if needed
perform_hpo=False # Disable Hyperparameter Optimization if not required
)
# Create a solution version manually
solution_version = personalize.CfnSolutionVersion(
self,
"PersonalizeRankingSolutionVersion",
solution_arn=solution.attr_arn
)
# Optionally, create a campaign (which deploys the solution version)
campaign = personalize.CfnCampaign(
self,
"PersonalizeRankingCampaign",
name="ranking-campaign",
solution_version_arn=solution_version.attr_solution_version_arn,
min_provisioned_tps=1
)
Relevant content
- Accepted Answer
- AWS OFFICIALUpdated 21 days ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
I can't use "perform_hpo" because my recipe is "aws-personalized-ranking-v2" I got this error: "HPO is not supported for recipe arn:aws:personalize:::recipe/aws-personalized-ranking-v2"
And I didn't find any documentation about "Training Schedule" for "performAutoML" or about "CDK SolutionVersion". Can you provide some?
There is no "personalize.CfnSolutionVersion" or "personalize.CfnCampaign", I didn't find them in the docs? Can you send a link to docs if any?