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