CleanRoomsML / Client / create_trained_model

create_trained_model

CleanRoomsML.Client.create_trained_model(**kwargs)

Creates a trained model from an associated configured model algorithm using data from any member of the collaboration.

See also: AWS API Documentation

Request Syntax

response = client.create_trained_model(
    membershipIdentifier='string',
    name='string',
    configuredModelAlgorithmAssociationArn='string',
    hyperparameters={
        'string': 'string'
    },
    environment={
        'string': 'string'
    },
    resourceConfig={
        'instanceCount': 123,
        'instanceType': 'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.m5.large'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5n.xlarge'|'ml.c5n.2xlarge'|'ml.c5n.4xlarge'|'ml.c5n.9xlarge'|'ml.c5n.18xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.m6i.large'|'ml.m6i.xlarge'|'ml.m6i.2xlarge'|'ml.m6i.4xlarge'|'ml.m6i.8xlarge'|'ml.m6i.12xlarge'|'ml.m6i.16xlarge'|'ml.m6i.24xlarge'|'ml.m6i.32xlarge'|'ml.c6i.xlarge'|'ml.c6i.2xlarge'|'ml.c6i.8xlarge'|'ml.c6i.4xlarge'|'ml.c6i.12xlarge'|'ml.c6i.16xlarge'|'ml.c6i.24xlarge'|'ml.c6i.32xlarge'|'ml.r5d.large'|'ml.r5d.xlarge'|'ml.r5d.2xlarge'|'ml.r5d.4xlarge'|'ml.r5d.8xlarge'|'ml.r5d.12xlarge'|'ml.r5d.16xlarge'|'ml.r5d.24xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge',
        'volumeSizeInGB': 123
    },
    stoppingCondition={
        'maxRuntimeInSeconds': 123
    },
    incrementalTrainingDataChannels=[
        {
            'trainedModelArn': 'string',
            'versionIdentifier': 'string',
            'channelName': 'string'
        },
    ],
    dataChannels=[
        {
            'mlInputChannelArn': 'string',
            'channelName': 'string',
            's3DataDistributionType': 'FullyReplicated'|'ShardedByS3Key'
        },
    ],
    trainingInputMode='File'|'FastFile'|'Pipe',
    description='string',
    kmsKeyArn='string',
    tags={
        'string': 'string'
    }
)
Parameters:
  • membershipIdentifier (string) –

    [REQUIRED]

    The membership ID of the member that is creating the trained model.

  • name (string) –

    [REQUIRED]

    The name of the trained model.

  • configuredModelAlgorithmAssociationArn (string) –

    [REQUIRED]

    The associated configured model algorithm used to train this model.

  • hyperparameters (dict) –

    Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process.

    • (string) –

      • (string) –

  • environment (dict) –

    The environment variables to set in the Docker container.

    • (string) –

      • (string) –

  • resourceConfig (dict) –

    [REQUIRED]

    Information about the EC2 resources that are used to train this model.

    • instanceCount (integer) –

      The number of resources that are used to train the model.

    • instanceType (string) – [REQUIRED]

      The instance type that is used to train the model.

    • volumeSizeInGB (integer) – [REQUIRED]

      The maximum size of the instance that is used to train the model.

  • stoppingCondition (dict) –

    The criteria that is used to stop model training.

    • maxRuntimeInSeconds (integer) –

      The maximum amount of time, in seconds, that model training can run before it is terminated.

  • incrementalTrainingDataChannels (list) –

    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).

    • (dict) –

      Defines an incremental training data channel that references a previously trained model. Incremental training allows you to update an existing trained model with new data, building upon the knowledge from a base model rather than training from scratch. This can significantly reduce training time and computational costs while improving model performance with additional data.

      • trainedModelArn (string) – [REQUIRED]

        The Amazon Resource Name (ARN) of the base trained model to use for incremental training. This model serves as the starting point for the incremental training process.

      • versionIdentifier (string) –

        The version identifier of the base trained model to use for incremental training. If not specified, the latest version of the trained model is used.

      • channelName (string) – [REQUIRED]

        The name of the incremental training data channel. This name is used to identify the channel during the training process and must be unique within the training job.

  • dataChannels (list) –

    [REQUIRED]

    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).

    • (dict) –

      Information about the model training data channel. A training data channel is a named data source that the training algorithms can consume.

      • mlInputChannelArn (string) – [REQUIRED]

        The Amazon Resource Name (ARN) of the ML input channel for this model training data channel.

      • channelName (string) – [REQUIRED]

        The name of the training data channel.

      • s3DataDistributionType (string) –

        Specifies how the training data stored in Amazon S3 should be distributed to training instances. This parameter controls the data distribution strategy for the training job:

        • FullyReplicated - The entire dataset is replicated on each training instance. This is suitable for smaller datasets and algorithms that require access to the complete dataset.

        • ShardedByS3Key - The dataset is distributed across training instances based on Amazon S3 key names. This is suitable for larger datasets and distributed training scenarios where each instance processes a subset of the data.

  • trainingInputMode (string) –

    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.

  • description (string) – The description of the trained model.

  • kmsKeyArn (string) – 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.

  • tags (dict) –

    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.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'trainedModelArn': 'string',
    'versionIdentifier': 'string'
}

Response Structure

  • (dict) –

    • trainedModelArn (string) –

      The Amazon Resource Name (ARN) of the trained model.

    • versionIdentifier (string) –

      The unique version identifier assigned to the newly created trained model. This identifier can be used to reference this specific version of the trained model in subsequent operations such as inference jobs or incremental training.

      The initial version identifier for the base version of the trained model is “NULL”.

Exceptions