createTrainedModel method
- required String configuredModelAlgorithmAssociationArn,
- required List<
ModelTrainingDataChannel> dataChannels, - required String membershipIdentifier,
- required String name,
- required ResourceConfig resourceConfig,
- String? description,
- Map<
String, String> ? environment, - Map<
String, String> ? hyperparameters, - List<
IncrementalTrainingDataChannel> ? incrementalTrainingDataChannels, - String? kmsKeyArn,
- String? mlModelTrainingPayerAccountId,
- StoppingCondition? stoppingCondition,
- Map<
String, String> ? tags, - TrainingInputMode? trainingInputMode,
Creates a trained model from an associated configured model algorithm using data from any member of the collaboration.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServiceException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter configuredModelAlgorithmAssociationArn :
The associated configured model algorithm used to train this model.
Parameter dataChannels :
Defines the data channels that are used as input for the trained model
request.
Limit: Maximum of 20 channels total (including both
dataChannels and
incrementalTrainingDataChannels).
Parameter membershipIdentifier :
The membership ID of the member that is creating the trained model.
Parameter name :
The name of the trained model.
Parameter resourceConfig :
Information about the EC2 resources that are used to train this model.
Parameter description :
The description of the trained model.
Parameter environment :
The environment variables to set in the Docker container.
Parameter hyperparameters :
Algorithm-specific parameters that influence the quality of the model. You
set hyperparameters before you start the learning process.
Parameter incrementalTrainingDataChannels :
Specifies the incremental training data channels for the trained model.
Incremental training allows you to create a new trained model with updates without retraining from scratch. You can specify up to one incremental training data channel that references a previously trained model and its version.
Limit: Maximum of 20 channels total (including both
incrementalTrainingDataChannels and
dataChannels).
Parameter kmsKeyArn :
The Amazon Resource Name (ARN) of the KMS key. This key is used to encrypt
and decrypt customer-owned data in the trained ML model and the associated
data.
Parameter mlModelTrainingPayerAccountId :
The account ID of the member that is responsible for paying for model
training costs.
Parameter stoppingCondition :
The criteria that is used to stop model training.
Parameter tags :
The optional metadata that you apply to the resource to help you
categorize and organize them. Each tag consists of a key and an optional
value, both of which you define.
The following basic restrictions apply to tags:
- Maximum number of tags per resource - 50.
- For each resource, each tag key must be unique, and each tag key can have only one value.
- Maximum key length - 128 Unicode characters in UTF-8.
- Maximum value length - 256 Unicode characters in UTF-8.
- If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
- Tag keys and values are case sensitive.
- Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.
Parameter trainingInputMode :
The input mode for accessing the training data. This parameter determines
how the training data is made available to the training algorithm. Valid
values are:
-
File- The training data is downloaded to the training instance and made available as files. -
FastFile- The training data is streamed directly from Amazon S3 to the training algorithm, providing faster access for large datasets. -
Pipe- The training data is streamed to the training algorithm using named pipes, which can improve performance for certain algorithms.
Implementation
Future<CreateTrainedModelResponse> createTrainedModel({
required String configuredModelAlgorithmAssociationArn,
required List<ModelTrainingDataChannel> dataChannels,
required String membershipIdentifier,
required String name,
required ResourceConfig resourceConfig,
String? description,
Map<String, String>? environment,
Map<String, String>? hyperparameters,
List<IncrementalTrainingDataChannel>? incrementalTrainingDataChannels,
String? kmsKeyArn,
String? mlModelTrainingPayerAccountId,
StoppingCondition? stoppingCondition,
Map<String, String>? tags,
TrainingInputMode? trainingInputMode,
}) async {
final $payload = <String, dynamic>{
'configuredModelAlgorithmAssociationArn':
configuredModelAlgorithmAssociationArn,
'dataChannels': dataChannels,
'name': name,
'resourceConfig': resourceConfig,
if (description != null) 'description': description,
if (environment != null) 'environment': environment,
if (hyperparameters != null) 'hyperparameters': hyperparameters,
if (incrementalTrainingDataChannels != null)
'incrementalTrainingDataChannels': incrementalTrainingDataChannels,
if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
if (mlModelTrainingPayerAccountId != null)
'mlModelTrainingPayerAccountId': mlModelTrainingPayerAccountId,
if (stoppingCondition != null) 'stoppingCondition': stoppingCondition,
if (tags != null) 'tags': tags,
if (trainingInputMode != null)
'trainingInputMode': trainingInputMode.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/memberships/${Uri.encodeComponent(membershipIdentifier)}/trained-models',
exceptionFnMap: _exceptionFns,
);
return CreateTrainedModelResponse.fromJson(response);
}