Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class CreateModelCommandProtected

Creates a new version of a model within an an Amazon Lookout for Vision project. CreateModel is an asynchronous operation in which Amazon Lookout for Vision trains, tests, and evaluates a new version of a model.

To get the current status, check the Status field returned in the response from DescribeModel.

If the project has a single dataset, Amazon Lookout for Vision internally splits the dataset to create a training and a test dataset. If the project has a training and a test dataset, Lookout for Vision uses the respective datasets to train and test the model.

After training completes, the evaluation metrics are stored at the location specified in OutputConfig.

This operation requires permissions to perform the lookoutvision:CreateModel operation. If you want to tag your model, you also require permission to the lookoutvision:TagResource operation.

Example

Use a bare-bones client and the command you need to make an API call.

import { LookoutVisionClient, CreateModelCommand } from "@aws-sdk/client-lookoutvision"; // ES Modules import
// const { LookoutVisionClient, CreateModelCommand } = require("@aws-sdk/client-lookoutvision"); // CommonJS import
const client = new LookoutVisionClient(config);
const input = { // CreateModelRequest
ProjectName: "STRING_VALUE", // required
Description: "STRING_VALUE",
ClientToken: "STRING_VALUE",
OutputConfig: { // OutputConfig
S3Location: { // S3Location
Bucket: "STRING_VALUE", // required
Prefix: "STRING_VALUE",
},
},
KmsKeyId: "STRING_VALUE",
Tags: [ // TagList
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
};
const command = new CreateModelCommand(input);
const response = await client.send(command);
// { // CreateModelResponse
// ModelMetadata: { // ModelMetadata
// CreationTimestamp: new Date("TIMESTAMP"),
// ModelVersion: "STRING_VALUE",
// ModelArn: "STRING_VALUE",
// Description: "STRING_VALUE",
// Status: "TRAINING" || "TRAINED" || "TRAINING_FAILED" || "STARTING_HOSTING" || "HOSTED" || "HOSTING_FAILED" || "STOPPING_HOSTING" || "SYSTEM_UPDATING" || "DELETING",
// StatusMessage: "STRING_VALUE",
// Performance: { // ModelPerformance
// F1Score: Number("float"),
// Recall: Number("float"),
// Precision: Number("float"),
// },
// },
// };

Param

CreateModelCommandInput

Returns

CreateModelCommandOutput

See

Throws

AccessDeniedException (client fault)

You are not authorized to perform the action.

Throws

ConflictException (client fault)

The update or deletion of a resource caused an inconsistent state.

Throws

InternalServerException (server fault)

Amazon Lookout for Vision experienced a service issue. Try your call again.

Throws

ResourceNotFoundException (client fault)

The resource could not be found.

Throws

ServiceQuotaExceededException (client fault)

A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for Vision in the Amazon Lookout for Vision Developer Guide.

Throws

ThrottlingException (client fault)

Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.

Throws

ValidationException (client fault)

An input validation error occured. For example, invalid characters in a project name, or if a pagination token is invalid.

Throws

LookoutVisionServiceException

Base exception class for all service exceptions from LookoutVision service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods