/
api_op_CreateAutoMLJobV2.go
243 lines (219 loc) · 9.11 KB
/
api_op_CreateAutoMLJobV2.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an Autopilot job also referred to as Autopilot experiment or AutoML job
// V2.
//
// [CreateAutoMLJobV2]and [DescribeAutoMLJobV2] are new versions of [CreateAutoMLJob] and [DescribeAutoMLJob] which offer backward compatibility.
//
// CreateAutoMLJobV2 can manage tabular problem types identical to those of its
// previous version CreateAutoMLJob , as well as time-series forecasting,
// non-tabular problem types such as image or text classification, and text
// generation (LLMs fine-tuning).
//
// Find guidelines about how to migrate a CreateAutoMLJob to CreateAutoMLJobV2 in [Migrate a CreateAutoMLJob to CreateAutoMLJobV2].
//
// For the list of available problem types supported by CreateAutoMLJobV2 , see [AutoMLProblemTypeConfig].
//
// You can find the best-performing model after you run an AutoML job V2 by
// calling [DescribeAutoMLJobV2].
//
// [CreateAutoMLJob]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJob.html
// [DescribeAutoMLJob]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJob.html
// [DescribeAutoMLJobV2]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html
// [CreateAutoMLJobV2]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJobV2.html
// [Migrate a CreateAutoMLJob to CreateAutoMLJobV2]: https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-create-experiment.html#autopilot-create-experiment-api-migrate-v1-v2
// [AutoMLProblemTypeConfig]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLProblemTypeConfig.html
func (c *Client) CreateAutoMLJobV2(ctx context.Context, params *CreateAutoMLJobV2Input, optFns ...func(*Options)) (*CreateAutoMLJobV2Output, error) {
if params == nil {
params = &CreateAutoMLJobV2Input{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAutoMLJobV2", params, optFns, c.addOperationCreateAutoMLJobV2Middlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAutoMLJobV2Output)
out.ResultMetadata = metadata
return out, nil
}
type CreateAutoMLJobV2Input struct {
// An array of channel objects describing the input data and their location. Each
// channel is a named input source. Similar to the [InputDataConfig]attribute in the CreateAutoMLJob
// input parameters. The supported formats depend on the problem type:
//
// - For tabular problem types: S3Prefix , ManifestFile .
//
// - For image classification: S3Prefix , ManifestFile , AugmentedManifestFile .
//
// - For text classification: S3Prefix .
//
// - For time-series forecasting: S3Prefix .
//
// - For text generation (LLMs fine-tuning): S3Prefix .
//
// [InputDataConfig]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJob.html#sagemaker-CreateAutoMLJob-request-InputDataConfig
//
// This member is required.
AutoMLJobInputDataConfig []types.AutoMLJobChannel
// Identifies an Autopilot job. The name must be unique to your account and is
// case insensitive.
//
// This member is required.
AutoMLJobName *string
// Defines the configuration settings of one of the supported problem types.
//
// This member is required.
AutoMLProblemTypeConfig types.AutoMLProblemTypeConfig
// Provides information about encryption and the Amazon S3 output path needed to
// store artifacts from an AutoML job.
//
// This member is required.
OutputDataConfig *types.AutoMLOutputDataConfig
// The ARN of the role that is used to access the data.
//
// This member is required.
RoleArn *string
// Specifies a metric to minimize or maximize as the objective of a job. If not
// specified, the default objective metric depends on the problem type. For the
// list of default values per problem type, see [AutoMLJobObjective].
//
// - For tabular problem types: You must either provide both the
// AutoMLJobObjective and indicate the type of supervised learning problem in
// AutoMLProblemTypeConfig ( TabularJobConfig.ProblemType ), or none at all.
//
// - For text generation problem types (LLMs fine-tuning): Fine-tuning language
// models in Autopilot does not require setting the AutoMLJobObjective field.
// Autopilot fine-tunes LLMs without requiring multiple candidates to be trained
// and evaluated. Instead, using your dataset, Autopilot directly fine-tunes your
// target model to enhance a default objective metric, the cross-entropy loss.
// After fine-tuning a language model, you can evaluate the quality of its
// generated text using different metrics. For a list of the available metrics, see
// [Metrics for fine-tuning LLMs in Autopilot].
//
// [Metrics for fine-tuning LLMs in Autopilot]: https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-llms-finetuning-metrics.html
// [AutoMLJobObjective]: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobObjective.html
AutoMLJobObjective *types.AutoMLJobObjective
// This structure specifies how to split the data into train and validation
// datasets.
//
// The validation and training datasets must contain the same headers. For jobs
// created by calling CreateAutoMLJob , the validation dataset must be less than 2
// GB in size.
//
// This attribute must not be set for the time-series forecasting problem type, as
// Autopilot automatically splits the input dataset into training and validation
// sets.
DataSplitConfig *types.AutoMLDataSplitConfig
// Specifies how to generate the endpoint name for an automatic one-click
// Autopilot model deployment.
ModelDeployConfig *types.ModelDeployConfig
// The security configuration for traffic encryption or Amazon VPC settings.
SecurityConfig *types.AutoMLSecurityConfig
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, such as by purpose, owner, or environment.
// For more information, see [Tagging Amazon Web ServicesResources]. Tag keys must be unique per resource.
//
// [Tagging Amazon Web ServicesResources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateAutoMLJobV2Output struct {
// The unique ARN assigned to the AutoMLJob when it is created.
//
// This member is required.
AutoMLJobArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAutoMLJobV2Middlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAutoMLJobV2{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAutoMLJobV2{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAutoMLJobV2"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAutoMLJobV2ValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAutoMLJobV2(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateAutoMLJobV2(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "CreateAutoMLJobV2",
}
}