1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package machinelearning
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/machinelearning/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Returns an MLModel that includes detailed metadata, data source information, and
16// the current status of the MLModel. GetMLModel provides results in normal or
17// verbose format.
18func (c *Client) GetMLModel(ctx context.Context, params *GetMLModelInput, optFns ...func(*Options)) (*GetMLModelOutput, error) {
19	if params == nil {
20		params = &GetMLModelInput{}
21	}
22
23	result, metadata, err := c.invokeOperation(ctx, "GetMLModel", params, optFns, addOperationGetMLModelMiddlewares)
24	if err != nil {
25		return nil, err
26	}
27
28	out := result.(*GetMLModelOutput)
29	out.ResultMetadata = metadata
30	return out, nil
31}
32
33type GetMLModelInput struct {
34
35	// The ID assigned to the MLModel at creation.
36	//
37	// This member is required.
38	MLModelId *string
39
40	// Specifies whether the GetMLModel operation should return Recipe. If true, Recipe
41	// is returned. If false, Recipe is not returned.
42	Verbose bool
43}
44
45// Represents the output of a GetMLModel operation, and provides detailed
46// information about a MLModel.
47type GetMLModelOutput struct {
48
49	// The approximate CPU time in milliseconds that Amazon Machine Learning spent
50	// processing the MLModel, normalized and scaled on computation resources.
51	// ComputeTime is only available if the MLModel is in the COMPLETED state.
52	ComputeTime *int64
53
54	// The time that the MLModel was created. The time is expressed in epoch time.
55	CreatedAt *time.Time
56
57	// The AWS user account from which the MLModel was created. The account type can be
58	// either an AWS root account or an AWS Identity and Access Management (IAM) user
59	// account.
60	CreatedByIamUser *string
61
62	// The current endpoint of the MLModel
63	EndpointInfo *types.RealtimeEndpointInfo
64
65	// The epoch time when Amazon Machine Learning marked the MLModel as COMPLETED or
66	// FAILED. FinishedAt is only available when the MLModel is in the COMPLETED or
67	// FAILED state.
68	FinishedAt *time.Time
69
70	// The location of the data file or directory in Amazon Simple Storage Service
71	// (Amazon S3).
72	InputDataLocationS3 *string
73
74	// The time of the most recent edit to the MLModel. The time is expressed in epoch
75	// time.
76	LastUpdatedAt *time.Time
77
78	// A link to the file that contains logs of the CreateMLModel operation.
79	LogUri *string
80
81	// The MLModel ID, which is same as the MLModelId in the request.
82	MLModelId *string
83
84	// Identifies the MLModel category. The following are the available types:
85	//
86	// *
87	// REGRESSION -- Produces a numeric result. For example, "What price should a house
88	// be listed at?"
89	//
90	// * BINARY -- Produces one of two possible results. For example,
91	// "Is this an e-commerce website?"
92	//
93	// * MULTICLASS -- Produces one of several
94	// possible results. For example, "Is this a HIGH, LOW or MEDIUM risk trade?"
95	MLModelType types.MLModelType
96
97	// A description of the most recent details about accessing the MLModel.
98	Message *string
99
100	// A user-supplied name or description of the MLModel.
101	Name *string
102
103	// The recipe to use when training the MLModel. The Recipe provides detailed
104	// information about the observation data to use during training, and manipulations
105	// to perform on the observation data during training. Note: This parameter is
106	// provided as part of the verbose format.
107	Recipe *string
108
109	// The schema used by all of the data files referenced by the DataSource. Note:
110	// This parameter is provided as part of the verbose format.
111	Schema *string
112
113	// The scoring threshold is used in binary classification MLModel models. It marks
114	// the boundary between a positive prediction and a negative prediction. Output
115	// values greater than or equal to the threshold receive a positive result from the
116	// MLModel, such as true. Output values less than the threshold receive a negative
117	// response from the MLModel, such as false.
118	ScoreThreshold *float32
119
120	// The time of the most recent edit to the ScoreThreshold. The time is expressed in
121	// epoch time.
122	ScoreThresholdLastUpdatedAt *time.Time
123
124	// Long integer type that is a 64-bit signed number.
125	SizeInBytes *int64
126
127	// The epoch time when Amazon Machine Learning marked the MLModel as INPROGRESS.
128	// StartedAt isn't available if the MLModel is in the PENDING state.
129	StartedAt *time.Time
130
131	// The current status of the MLModel. This element can have one of the following
132	// values:
133	//
134	// * PENDING - Amazon Machine Learning (Amazon ML) submitted a request to
135	// describe a MLModel.
136	//
137	// * INPROGRESS - The request is processing.
138	//
139	// * FAILED - The
140	// request did not run to completion. The ML model isn't usable.
141	//
142	// * COMPLETED - The
143	// request completed successfully.
144	//
145	// * DELETED - The MLModel is marked as deleted.
146	// It isn't usable.
147	Status types.EntityStatus
148
149	// The ID of the training DataSource.
150	TrainingDataSourceId *string
151
152	// A list of the training parameters in the MLModel. The list is implemented as a
153	// map of key-value pairs. The following is the current set of training
154	// parameters:
155	//
156	// * sgd.maxMLModelSizeInBytes - The maximum allowed size of the
157	// model. Depending on the input data, the size of the model might affect its
158	// performance. The value is an integer that ranges from 100000 to 2147483648. The
159	// default value is 33554432.
160	//
161	// * sgd.maxPasses - The number of times that the
162	// training process traverses the observations to build the MLModel. The value is
163	// an integer that ranges from 1 to 10000. The default value is 10.
164	//
165	// *
166	// sgd.shuffleType - Whether Amazon ML shuffles the training data. Shuffling data
167	// improves a model's ability to find the optimal solution for a variety of data
168	// types. The valid values are auto and none. The default value is none. We
169	// strongly recommend that you shuffle your data.
170	//
171	// * sgd.l1RegularizationAmount -
172	// The coefficient regularization L1 norm. It controls overfitting the data by
173	// penalizing large coefficients. This tends to drive coefficients to zero,
174	// resulting in a sparse feature set. If you use this parameter, start by
175	// specifying a small value, such as 1.0E-08. The value is a double that ranges
176	// from 0 to MAX_DOUBLE. The default is to not use L1 normalization. This parameter
177	// can't be used when L2 is specified. Use this parameter sparingly.
178	//
179	// *
180	// sgd.l2RegularizationAmount - The coefficient regularization L2 norm. It controls
181	// overfitting the data by penalizing large coefficients. This tends to drive
182	// coefficients to small, nonzero values. If you use this parameter, start by
183	// specifying a small value, such as 1.0E-08. The value is a double that ranges
184	// from 0 to MAX_DOUBLE. The default is to not use L2 normalization. This parameter
185	// can't be used when L1 is specified. Use this parameter sparingly.
186	TrainingParameters map[string]string
187
188	// Metadata pertaining to the operation's result.
189	ResultMetadata middleware.Metadata
190}
191
192func addOperationGetMLModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
193	err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMLModel{}, middleware.After)
194	if err != nil {
195		return err
196	}
197	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMLModel{}, middleware.After)
198	if err != nil {
199		return err
200	}
201	if err = addSetLoggerMiddleware(stack, options); err != nil {
202		return err
203	}
204	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
205		return err
206	}
207	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
208		return err
209	}
210	if err = addResolveEndpointMiddleware(stack, options); err != nil {
211		return err
212	}
213	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
214		return err
215	}
216	if err = addRetryMiddlewares(stack, options); err != nil {
217		return err
218	}
219	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
220		return err
221	}
222	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
223		return err
224	}
225	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
226		return err
227	}
228	if err = addClientUserAgent(stack); err != nil {
229		return err
230	}
231	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
232		return err
233	}
234	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
235		return err
236	}
237	if err = addOpGetMLModelValidationMiddleware(stack); err != nil {
238		return err
239	}
240	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMLModel(options.Region), middleware.Before); err != nil {
241		return err
242	}
243	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
244		return err
245	}
246	if err = addResponseErrorMiddleware(stack); err != nil {
247		return err
248	}
249	if err = addRequestResponseLogging(stack, options); err != nil {
250		return err
251	}
252	return nil
253}
254
255func newServiceMetadataMiddleware_opGetMLModel(region string) *awsmiddleware.RegisterServiceMetadata {
256	return &awsmiddleware.RegisterServiceMetadata{
257		Region:        region,
258		ServiceID:     ServiceID,
259		SigningName:   "machinelearning",
260		OperationName: "GetMLModel",
261	}
262}
263