本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
创建解决方案版本
完成后创建和配置解决方案,您就可以开始训练了:
-
如果您的解决方案使用自动训练,则该解决方案会按照您指定的训练频率为您创建解决方案版本。默认情况下,所有新解决方案都使用自动训练,每 7 天创建一次新的解决方案版本。您仍然可以手动创建解决方案版本。有关更多信息,请参阅 配置自动训练。
-
如果您关闭解决方案的 auto training,或者想要手动训练,则可以手动创建解决方案版本。解决方案版本 是指经过训练的机器学习模型。您可以使用控制台、 AWS Command Line Interface (AWS CLI) 或 AWS 软件开发工具包创建解决方案版本。如果解决方案版本的状态为 CREATE_PENDING 或 CREATE_IN_PROGRESS,则您可以使用 StopSolutionVersionCreation 操作来停止解决方案版本的创建过程。请参阅 停止创建解决方案版本。
如果由于错误而无法完成训练,则您无需支付训练费用。如果解决方案版本的状态为 CREATE_PENDING 或 CREATE_IN_PROGRESS,则您可以停止解决方案版本的创建过程。要停止创建解决方案版本,请导航至解决方案版本详细信息页面,然后选择停止。请参阅 停止创建解决方案版本。
创建解决方案版本(控制台)
要使用 Amazon Personalize 控制台手动创建新的解决方案版本,您需要从解决方案的详细信息页面开始培训。
创建新解决方案版本
-
打开 Amazon Personalize 控制台(网址为 https://console.aws.amazon.com/personalize/home
),并登录您的账户。 -
导航到数据集组页面,然后选择包含新解决方案的数据集组。
-
在导航窗格中的自定义资源下,选择解决方案和配方。
-
在解决方案和食谱页面上,选择要创建解决方案版本的解决方案。
-
在解决方案概述页面上,选择创建解决方案版本以开始训练新模型。
在解决方案详细信息页面上,您可以在解决方案版本部分跟踪训练进度。训练完成后,状态会变为活动,您可以使用 Amazon Personalize 提供的指标对其进行评估。有关更多信息,请参阅 使用指标评估 Amazon Personalize 解决方案版本。
当解决方案版本处于活动状态时,您就可以使用它来获取建议了。如何使用有效的解决方案版本取决于您如何获得推荐:
要获得实时推荐,您可以通过 Amazon Personalize 活动部署有效的解决方案版本。您可以使用该活动为用户获取推荐。请参阅 通过活动部署 Amazon Personalize 解决方案版本。
-
对于批量建议,您可以在创建批处理推理作业或批处理区段作业时指定 ACTIVE 解决方案版本。请参阅 获取批量商品推荐 或 获取批量用户细分。
创建解决方案版本 (AWS CLI)
当您的解决方案处于活动状态时,通过运行以下命令来训练模型。将 solution arn
替换为 创建和配置解决方案 中的解决方案 Amazon 资源名称 (ARN)。
aws personalize create-solution-version \ --solution-arn
solution arn
这将显示解决方案版本 ARN,例如:
{ "solutionVersionArn": "arn:aws:personalize:us-west-2:acct-id:solution/SolutionName/<version-id>" }
通过使用 describe-solution-version
命令来检查解决方案版本的训练状态。提供上一步中返回的解决方案版本 ARN。有关该 API 的更多信息,请参阅DescribeSolutionVersion。
aws personalize describe-solution-version \ --solution-version-arn
solution version arn
将显示解决方案版本的属性和训练 status
。最初,状态显示为 CREATE PENDING,例如:
{ "solutionVersion": { "solutionVersionArn": "arn:aws:personalize:us-west-2:acct-id:solution/solutionName/<version-id>", ..., "status": "CREATE PENDING" } }
训练完成后,status
会变为 ACTIVE
,您可以使用 Amazon Personalize 提供的指标对其进行评估。有关更多信息,请参阅 使用指标评估 Amazon Personalize 解决方案版本。如果由于错误而无法完成训练,则您无需支付训练费用。
如果解决方案版本的状态为 CREATE_PENDING 或 CREATE_IN_PROGRESS,则您可以使用 StopSolutionVersionCreation 操作来停止解决方案版本的创建过程。请参阅 停止创建解决方案版本。
当解决方案版本处于活动状态时,您就可以使用它来获取建议了。如何使用有效的解决方案版本取决于您如何获得推荐:
要获得实时推荐,您可以通过 Amazon Personalize 活动部署有效的解决方案版本。您可以使用该活动为用户获取推荐。请参阅 通过活动部署 Amazon Personalize 解决方案版本。
-
对于批量建议,您可以在创建批处理推理作业或批处理区段作业时指定 ACTIVE 解决方案版本。请参阅 获取批量商品推荐 或 获取批量用户细分。
创建解决方案版本 (AWS SDK)
当您的解决方案处于活动状态时,使用以下代码创建解决方案版本。指定 创建和配置解决方案 中的 Amazon 资源名称(ARN)。使用 DescribeSolutionVersion 操作来检索解决方案版本的状态。
要检查当前解决方案版本状态,请调用 DescribeSolutionVersion 操作并传递从 CreateSolutionVersion
操作返回的解决方案版本的 ARN。训练完成后,status
会变为 ACTIVE
,您可以使用 Amazon Personalize 提供的指标对其进行评估。有关更多信息,请参阅 使用指标评估 Amazon Personalize 解决方案版本。如果由于错误而无法完成训练,则您无需支付训练费用。
如果解决方案版本的状态为 CREATE_PENDING 或 CREATE_IN_PROGRESS,则您可以使用 StopSolutionVersionCreation 操作来停止解决方案版本的创建过程。请参阅 停止创建解决方案版本。
当解决方案版本处于活动状态时,您就可以使用它来获取建议了。如何使用有效的解决方案版本取决于您如何获得推荐:
要获得实时推荐,您可以通过 Amazon Personalize 活动部署有效的解决方案版本。您可以使用该活动为用户获取推荐。请参阅 通过活动部署 Amazon Personalize 解决方案版本。
-
对于批量建议,您可以在创建批处理推理作业或批处理区段作业时指定 ACTIVE 解决方案版本。请参阅 获取批量商品推荐 或 获取批量用户细分。