Skip to content

Commit 65475aa

Browse files
author
awstools
committed
feat(client-personalize): This releases auto training capability while creating a solution and automatically syncing latest solution versions when creating/updating a campaign
1 parent 3260357 commit 65475aa

13 files changed

+335
-60
lines changed

clients/client-personalize/src/commands/CreateCampaignCommand.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ export interface CreateCampaignCommandInput extends CreateCampaignRequest {}
2727
export interface CreateCampaignCommandOutput extends CreateCampaignResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Creates a campaign that deploys a solution version. When a client calls the
30+
* <important>
31+
* <p> You incur campaign costs while it is active. To avoid unnecessary costs, make sure to delete the campaign when you are finished. For information about campaign
32+
* costs, see <a href="https://aws.amazon.com/personalize/pricing/">Amazon Personalize pricing</a>.</p>
33+
* </important>
34+
* <p>Creates a campaign that deploys a solution version. When a client calls the
3135
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_RS_GetRecommendations.html">GetRecommendations</a>
3236
* and
3337
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_RS_GetPersonalizedRanking.html">GetPersonalizedRanking</a>
@@ -113,6 +117,7 @@ export interface CreateCampaignCommandOutput extends CreateCampaignResponse, __M
113117
* "<keys>": "STRING_VALUE",
114118
* },
115119
* enableMetadataWithRecommendations: true || false,
120+
* syncWithLatestSolutionVersion: true || false,
116121
* },
117122
* tags: [ // Tags
118123
* { // Tag

clients/client-personalize/src/commands/CreateSolutionCommand.ts

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,32 @@ export interface CreateSolutionCommandInput extends CreateSolutionRequest {}
2727
export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Creates the configuration for training a model. A trained model is known as
31-
* a solution version. After the configuration is created, you train the model (create a solution version)
32-
* by calling the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolutionVersion.html">CreateSolutionVersion</a> operation. Every time you call
33-
* <code>CreateSolutionVersion</code>, a new version of the solution is created.</p>
34-
* <p>After creating a solution version, you check its accuracy by calling
35-
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_GetSolutionMetrics.html">GetSolutionMetrics</a>. When you are satisfied with the version, you
30+
* <important>
31+
* <p>After you create a solution, you can’t change its configuration. By default, all new solutions use automatic training. With automatic training, you incur training costs while
32+
* your solution is active. You can't stop automatic training for a solution. To avoid unnecessary costs, make sure to delete the solution when you are finished. For information about training
33+
* costs, see <a href="https://aws.amazon.com/personalize/pricing/">Amazon Personalize pricing</a>.</p>
34+
* </important>
35+
* <p>Creates the configuration for training a model (creating a solution version). This configuration
36+
* includes the recipe to use for model training and optional training configuration, such as columns to use
37+
* in training and feature transformation parameters. For more information about configuring a solution, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/customizing-solution-config.html">Creating and configuring a solution</a>.
38+
* </p>
39+
* <p>
40+
* By default, new solutions use automatic training to create solution versions every 7 days. You can change the training frequency.
41+
* Automatic solution version creation starts one hour after the solution is ACTIVE. If you manually create a solution version within
42+
* the hour, the solution skips the first automatic training. For more information,
43+
* see <a href="https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html">Configuring automatic training</a>.</p>
44+
* <p>
45+
* To turn off automatic training, set <code>performAutoTraining</code> to false. If you turn off automatic training, you must manually create a solution version
46+
* by calling the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolutionVersion.html">CreateSolutionVersion</a> operation.</p>
47+
* <p>After training starts, you can
48+
* get the solution version's Amazon Resource Name (ARN) with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html">ListSolutionVersions</a> API operation.
49+
* To get its status, use the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a>.
50+
* </p>
51+
* <p>After training completes you can evaluate model accuracy by calling
52+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_GetSolutionMetrics.html">GetSolutionMetrics</a>. When you are satisfied with the solution version, you
3653
* deploy it using <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateCampaign.html">CreateCampaign</a>. The campaign provides recommendations
3754
* to a client through the
3855
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_RS_GetRecommendations.html">GetRecommendations</a> API.</p>
39-
* <p>To train a model, Amazon Personalize requires training data and a recipe. The training data
40-
* comes from the dataset group that you provide in the request. A recipe specifies
41-
* the training algorithm and a feature transformation. You can specify one of the predefined
42-
* recipes provided by Amazon Personalize. </p>
4356
* <note>
4457
* <p>Amazon Personalize doesn't support configuring the <code>hpoObjective</code>
4558
* for solution hyperparameter optimization at this time.</p>
@@ -56,8 +69,8 @@ export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __M
5669
* <p>DELETE PENDING > DELETE IN_PROGRESS</p>
5770
* </li>
5871
* </ul>
59-
* <p>To get the status of the solution, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a>. Wait
60-
* until the status shows as ACTIVE before calling <code>CreateSolutionVersion</code>.</p>
72+
* <p>To get the status of the solution, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a>. If you use
73+
* manual training, the status must be ACTIVE before you call <code>CreateSolutionVersion</code>.</p>
6174
* <p class="title">
6275
* <b>Related APIs</b>
6376
* </p>
@@ -105,6 +118,7 @@ export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __M
105118
* name: "STRING_VALUE", // required
106119
* performHPO: true || false,
107120
* performAutoML: true || false,
121+
* performAutoTraining: true || false,
108122
* recipeArn: "STRING_VALUE",
109123
* datasetGroupArn: "STRING_VALUE", // required
110124
* eventType: "STRING_VALUE",
@@ -168,6 +182,9 @@ export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __M
168182
* ],
169183
* },
170184
* },
185+
* autoTrainingConfig: { // AutoTrainingConfig
186+
* schedulingExpression: "STRING_VALUE",
187+
* },
171188
* },
172189
* tags: [ // Tags
173190
* { // Tag

clients/client-personalize/src/commands/CreateSolutionVersionCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface CreateSolutionVersionCommandOutput extends CreateSolutionVersio
103103
* const input = { // CreateSolutionVersionRequest
104104
* name: "STRING_VALUE",
105105
* solutionArn: "STRING_VALUE", // required
106-
* trainingMode: "FULL" || "UPDATE",
106+
* trainingMode: "FULL" || "UPDATE" || "AUTOTRAIN",
107107
* tags: [ // Tags
108108
* { // Tag
109109
* tagKey: "STRING_VALUE", // required

clients/client-personalize/src/commands/DescribeCampaignCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export interface DescribeCampaignCommandOutput extends DescribeCampaignResponse,
6262
* // "<keys>": "STRING_VALUE",
6363
* // },
6464
* // enableMetadataWithRecommendations: true || false,
65+
* // syncWithLatestSolutionVersion: true || false,
6566
* // },
6667
* // status: "STRING_VALUE",
6768
* // failureReason: "STRING_VALUE",
@@ -75,6 +76,7 @@ export interface DescribeCampaignCommandOutput extends DescribeCampaignResponse,
7576
* // "<keys>": "STRING_VALUE",
7677
* // },
7778
* // enableMetadataWithRecommendations: true || false,
79+
* // syncWithLatestSolutionVersion: true || false,
7880
* // },
7981
* // status: "STRING_VALUE",
8082
* // failureReason: "STRING_VALUE",

clients/client-personalize/src/commands/DescribeSolutionCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface DescribeSolutionCommandOutput extends DescribeSolutionResponse,
4646
* // solutionArn: "STRING_VALUE",
4747
* // performHPO: true || false,
4848
* // performAutoML: true || false,
49+
* // performAutoTraining: true || false,
4950
* // recipeArn: "STRING_VALUE",
5051
* // datasetGroupArn: "STRING_VALUE",
5152
* // eventType: "STRING_VALUE",
@@ -109,6 +110,9 @@ export interface DescribeSolutionCommandOutput extends DescribeSolutionResponse,
109110
* // ],
110111
* // },
111112
* // },
113+
* // autoTrainingConfig: { // AutoTrainingConfig
114+
* // schedulingExpression: "STRING_VALUE",
115+
* // },
112116
* // },
113117
* // autoMLResult: { // AutoMLResult
114118
* // bestRecipeArn: "STRING_VALUE",
@@ -119,6 +123,8 @@ export interface DescribeSolutionCommandOutput extends DescribeSolutionResponse,
119123
* // latestSolutionVersion: { // SolutionVersionSummary
120124
* // solutionVersionArn: "STRING_VALUE",
121125
* // status: "STRING_VALUE",
126+
* // trainingMode: "FULL" || "UPDATE" || "AUTOTRAIN",
127+
* // trainingType: "AUTOMATIC" || "MANUAL",
122128
* // creationDateTime: new Date("TIMESTAMP"),
123129
* // lastUpdatedDateTime: new Date("TIMESTAMP"),
124130
* // failureReason: "STRING_VALUE",

clients/client-personalize/src/commands/DescribeSolutionVersionCommand.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ export interface DescribeSolutionVersionCommandOutput extends DescribeSolutionVe
110110
* // ],
111111
* // },
112112
* // },
113+
* // autoTrainingConfig: { // AutoTrainingConfig
114+
* // schedulingExpression: "STRING_VALUE",
115+
* // },
113116
* // },
114117
* // trainingHours: Number("double"),
115-
* // trainingMode: "FULL" || "UPDATE",
118+
* // trainingMode: "FULL" || "UPDATE" || "AUTOTRAIN",
116119
* // tunedHPOParams: { // TunedHPOParams
117120
* // algorithmHyperParameters: {
118121
* // "<keys>": "STRING_VALUE",
@@ -122,6 +125,7 @@ export interface DescribeSolutionVersionCommandOutput extends DescribeSolutionVe
122125
* // failureReason: "STRING_VALUE",
123126
* // creationDateTime: new Date("TIMESTAMP"),
124127
* // lastUpdatedDateTime: new Date("TIMESTAMP"),
128+
* // trainingType: "AUTOMATIC" || "MANUAL",
125129
* // },
126130
* // };
127131
*

clients/client-personalize/src/commands/ListSolutionVersionsCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export interface ListSolutionVersionsCommandOutput extends ListSolutionVersionsR
4848
* // { // SolutionVersionSummary
4949
* // solutionVersionArn: "STRING_VALUE",
5050
* // status: "STRING_VALUE",
51+
* // trainingMode: "FULL" || "UPDATE" || "AUTOTRAIN",
52+
* // trainingType: "AUTOMATIC" || "MANUAL",
5153
* // creationDateTime: new Date("TIMESTAMP"),
5254
* // lastUpdatedDateTime: new Date("TIMESTAMP"),
5355
* // failureReason: "STRING_VALUE",

clients/client-personalize/src/commands/ListSolutionsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface ListSolutionsCommandInput extends ListSolutionsRequest {}
2727
export interface ListSolutionsCommandOutput extends ListSolutionsResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Returns a list of solutions that use the given dataset group.
30+
* <p>Returns a list of solutions in a given dataset group.
3131
* When a dataset group is not specified, all the solutions associated with the account are listed.
3232
* The response provides the properties for each solution, including the Amazon Resource Name (ARN).
3333
* For more information on solutions, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html">CreateSolution</a>.</p>

clients/client-personalize/src/commands/UntagResourceCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface UntagResourceCommandInput extends UntagResourceRequest {}
2727
export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Remove <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> that are attached to a resource.</p>
30+
* <p>Removes the specified tags that are attached to a resource. For more information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/tags-remove.html">Removing tags from Amazon Personalize resources</a>.</p>
3131
* @example
3232
* Use a bare-bones client and the command you need to make an API call.
3333
* ```javascript

clients/client-personalize/src/commands/UpdateCampaignCommand.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,19 @@ export interface UpdateCampaignCommandOutput extends UpdateCampaignResponse, __M
2929
/**
3030
* <p>
3131
* Updates a campaign to deploy a retrained solution version with an existing campaign, change your campaign's <code>minProvisionedTPS</code>,
32-
* or modify your campaign's configuration, such as the exploration configuration.
33-
* </p>
32+
* or modify your campaign's configuration. For example, you can set <code>enableMetadataWithRecommendations</code> to true for an existing campaign.</p>
33+
* <p>
34+
* To update a campaign to start automatically using the latest solution version, specify the following:</p>
35+
* <ul>
36+
* <li>
37+
* <p>For the <code>SolutionVersionArn</code> parameter, specify the Amazon Resource Name (ARN) of your solution in
38+
* <code>SolutionArn/$LATEST</code> format. </p>
39+
* </li>
40+
* <li>
41+
* <p> In the <code>campaignConfig</code>, set <code>syncWithLatestSolutionVersion</code> to <code>true</code>.
42+
* </p>
43+
* </li>
44+
* </ul>
3445
* <p>To update a campaign, the campaign status must be ACTIVE or CREATE FAILED.
3546
* Check the campaign status using the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeCampaign.html">DescribeCampaign</a> operation.</p>
3647
* <note>
@@ -55,6 +66,7 @@ export interface UpdateCampaignCommandOutput extends UpdateCampaignResponse, __M
5566
* "<keys>": "STRING_VALUE",
5667
* },
5768
* enableMetadataWithRecommendations: true || false,
69+
* syncWithLatestSolutionVersion: true || false,
5870
* },
5971
* };
6072
* const command = new UpdateCampaignCommand(input);

0 commit comments

Comments
 (0)