Skip to content

start_ml_model_transform_job async

start_ml_model_transform_job(
    model_transform_output_s3_location: str,
    *,
    config_overrides: Optional[AsyncneptunedataClientConfig] = None,
    id: Optional[str] = None,
    data_processing_job_id: Optional[str] = None,
    ml_model_training_job_id: Optional[str] = None,
    training_job_name: Optional[str] = None,
    sagemaker_iam_role_arn: Optional[str] = None,
    neptune_iam_role_arn: Optional[str] = None,
    custom_model_transform_parameters: Optional[CustomModelTransformParameters] = None,
    base_processing_instance_type: Optional[str] = None,
    base_processing_instance_volume_size_in_gb: Optional[int] = None,
    subnets: Optional[StringList] = None,
    security_group_ids: Optional[StringList] = None,
    volume_encryption_kms_key: Optional[str] = None,
    s3_output_encryption_kms_key: Optional[str] = None,
) -> StartMLModelTransformJobOutput

Creates a new model transform job. See Use a trained model to generate new model artifacts.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:StartMLModelTransformJob IAM action in that cluster.

Parameters:

  • id (Optional[str], default: None ) –

    A unique identifier for the new job. The default is an autogenerated UUID.

  • data_processing_job_id (Optional[str], default: None ) –

    The job ID of a completed data-processing job. You must include either dataProcessingJobId and a mlModelTrainingJobId, or a trainingJobName.

  • ml_model_training_job_id (Optional[str], default: None ) –

    The job ID of a completed model-training job. You must include either dataProcessingJobId and a mlModelTrainingJobId, or a trainingJobName.

  • training_job_name (Optional[str], default: None ) –

    The name of a completed SageMaker training job. You must include either dataProcessingJobId and a mlModelTrainingJobId, or a trainingJobName.

  • model_transform_output_s3_location (str) –

    The location in Amazon S3 where the model artifacts are to be stored.

  • sagemaker_iam_role_arn (Optional[str], default: None ) –

    The ARN of an IAM role for SageMaker execution. This must be listed in your DB cluster parameter group or an error will occur.

  • neptune_iam_role_arn (Optional[str], default: None ) –

    The ARN of an IAM role that provides Neptune access to SageMaker and Amazon S3 resources. This must be listed in your DB cluster parameter group or an error will occur.

  • custom_model_transform_parameters (Optional[CustomModelTransformParameters], default: None ) –

    Configuration information for a model transform using a custom model. The customModelTransformParameters object contains the following fields, which must have values compatible with the saved model parameters from the training job:

  • base_processing_instance_type (Optional[str], default: None ) –

    The type of ML instance used in preparing and managing training of ML models. This is an ML compute instance chosen based on memory requirements for processing the training data and model.

  • base_processing_instance_volume_size_in_gb (Optional[int], default: None ) –

    The disk volume size of the training instance in gigabytes. The default is 0. Both input data and the output model are stored on disk, so the volume size must be large enough to hold both data sets. If not specified or 0, Neptune ML selects a disk volume size based on the recommendation generated in the data processing step.

  • subnets (Optional[StringList], default: None ) –

    The IDs of the subnets in the Neptune VPC. The default is None.

  • security_group_ids (Optional[StringList], default: None ) –

    The VPC security group IDs. The default is None.

  • volume_encryption_kms_key (Optional[str], default: None ) –

    The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instances that run the training job. The default is None.

  • s3_output_encryption_kms_key (Optional[str], default: None ) –

    The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt the output of the processing job. The default is none.

Raises:

Source code in docs_src/capo_neptunedata/_services/async_neptunedata.py
async def start_ml_model_transform_job(
    self,
    model_transform_output_s3_location: str,
    *,
    config_overrides: Optional[AsyncneptunedataClientConfig] = None,
    id: Optional[str] = None,
    data_processing_job_id: Optional[str] = None,
    ml_model_training_job_id: Optional[str] = None,
    training_job_name: Optional[str] = None,
    sagemaker_iam_role_arn: Optional[str] = None,
    neptune_iam_role_arn: Optional[str] = None,
    custom_model_transform_parameters: Optional[
        "capo_neptunedata.types.custom_model_transform_parameters.CustomModelTransformParameters"
    ] = None,
    base_processing_instance_type: Optional[str] = None,
    base_processing_instance_volume_size_in_gb: Optional[int] = None,
    subnets: Optional["capo_neptunedata.types.string_list.StringList"] = None,
    security_group_ids: Optional[
        "capo_neptunedata.types.string_list.StringList"
    ] = None,
    volume_encryption_kms_key: Optional[str] = None,
    s3_output_encryption_kms_key: Optional[str] = None,
) -> "capo_neptunedata.types.start_ml_model_transform_job_output.StartMLModelTransformJobOutput":
    """<p>Creates a new model transform job. See <a href="https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html">Use a trained model to generate new model artifacts</a>.</p> <p>When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the <a href="https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#startmlmodeltransformjob">neptune-db:StartMLModelTransformJob</a> IAM action in that cluster.</p>

    Args:
        id: <p>A unique identifier for the new job. The default is an autogenerated UUID.</p>
        data_processing_job_id: <p>The job ID of a completed data-processing job. You must include either <code>dataProcessingJobId</code> and a <code>mlModelTrainingJobId</code>, or a <code>trainingJobName</code>.</p>
        ml_model_training_job_id: <p>The job ID of a completed model-training job. You must include either <code>dataProcessingJobId</code> and a <code>mlModelTrainingJobId</code>, or a <code>trainingJobName</code>.</p>
        training_job_name: <p>The name of a completed SageMaker training job. You must include either <code>dataProcessingJobId</code> and a <code>mlModelTrainingJobId</code>, or a <code>trainingJobName</code>.</p>
        model_transform_output_s3_location: <p>The location in Amazon S3 where the model artifacts are to be stored.</p>
        sagemaker_iam_role_arn: <p>The ARN of an IAM role for SageMaker execution. This must be listed in your DB cluster parameter group or an error will occur.</p>
        neptune_iam_role_arn: <p>The ARN of an IAM role that provides Neptune access to SageMaker and Amazon S3 resources. This must be listed in your DB cluster parameter group or an error will occur.</p>
        custom_model_transform_parameters: <p>Configuration information for a model transform using a custom model. The <code>customModelTransformParameters</code> object contains the following fields, which must have values compatible with the saved model parameters from the training job:</p>
        base_processing_instance_type: <p>The type of ML instance used in preparing and managing training of ML models. This is an ML compute instance chosen based on memory requirements for processing the training data and model.</p>
        base_processing_instance_volume_size_in_gb: <p>The disk volume size of the training instance in gigabytes. The default is 0. Both input data and the output model are stored on disk, so the volume size must be large enough to hold both data sets. If not specified or 0, Neptune ML selects a disk volume size based on the recommendation generated in the data processing step.</p>
        subnets: <p>The IDs of the subnets in the Neptune VPC. The default is None.</p>
        security_group_ids: <p>The VPC security group IDs. The default is None.</p>
        volume_encryption_kms_key: <p>The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instances that run the training job. The default is None.</p>
        s3_output_encryption_kms_key: <p>The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt the output of the processing job. The default is none.</p>

    Raises:
        capo_neptunedata.errors.bad_request_exception.BadRequestException: <p>Raised when a request is submitted that cannot be processed.</p>
        capo_neptunedata.errors.client_timeout_exception.ClientTimeoutException: <p>Raised when a request timed out in the client.</p>
        capo_neptunedata.errors.constraint_violation_exception.ConstraintViolationException: <p>Raised when a value in a request field did not satisfy required constraints.</p>
        capo_neptunedata.errors.illegal_argument_exception.IllegalArgumentException: <p>Raised when an argument in a request is not supported.</p>
        capo_neptunedata.errors.invalid_argument_exception.InvalidArgumentException: <p>Raised when an argument in a request has an invalid value.</p>
        capo_neptunedata.errors.invalid_parameter_exception.InvalidParameterException: <p>Raised when a parameter value is not valid.</p>
        capo_neptunedata.errors.missing_parameter_exception.MissingParameterException: <p>Raised when a required parameter is missing.</p>
        capo_neptunedata.errors.ml_resource_not_found_exception.MLResourceNotFoundException: <p>Raised when a specified machine-learning resource could not be found.</p>
        capo_neptunedata.errors.preconditions_failed_exception.PreconditionsFailedException: <p>Raised when a precondition for processing a request is not satisfied.</p>
        capo_neptunedata.errors.too_many_requests_exception.TooManyRequestsException: <p>Raised when the number of requests being processed exceeds the limit.</p>
        capo_neptunedata.errors.unsupported_operation_exception.UnsupportedOperationException: <p>Raised when a request attempts to initiate an operation that is not supported.</p>
        capo_neptunedata.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptunedata.types.start_ml_model_transform_job_input.StartMLModelTransformJobInput]",
    ) -> AsyncOperationResponse[
        "capo_neptunedata.types.start_ml_model_transform_job_output.StartMLModelTransformJobOutput"
    ]:
        import capo_neptunedata._operations.amazon_neptune_dataplane.start_ml_model_transform_job

        (
            output,
            http_response,
        ) = await capo_neptunedata._operations.amazon_neptune_dataplane.start_ml_model_transform_job.async_start_ml_model_transform_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMLModelTransformJob")
    )
    input_: capo_neptunedata.types.start_ml_model_transform_job_input.StartMLModelTransformJobInput = {
        "model_transform_output_s3_location": model_transform_output_s3_location
    }
    if id is not None:
        input_["id"] = id
    if data_processing_job_id is not None:
        input_["data_processing_job_id"] = data_processing_job_id
    if ml_model_training_job_id is not None:
        input_["ml_model_training_job_id"] = ml_model_training_job_id
    if training_job_name is not None:
        input_["training_job_name"] = training_job_name
    if sagemaker_iam_role_arn is not None:
        input_["sagemaker_iam_role_arn"] = sagemaker_iam_role_arn
    if neptune_iam_role_arn is not None:
        input_["neptune_iam_role_arn"] = neptune_iam_role_arn
    if custom_model_transform_parameters is not None:
        input_["custom_model_transform_parameters"] = (
            custom_model_transform_parameters
        )
    if base_processing_instance_type is not None:
        input_["base_processing_instance_type"] = base_processing_instance_type
    if base_processing_instance_volume_size_in_gb is not None:
        input_["base_processing_instance_volume_size_in_gb"] = (
            base_processing_instance_volume_size_in_gb
        )
    if subnets is not None:
        input_["subnets"] = subnets
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if volume_encryption_kms_key is not None:
        input_["volume_encryption_kms_key"] = volume_encryption_kms_key
    if s3_output_encryption_kms_key is not None:
        input_["s3_output_encryption_kms_key"] = s3_output_encryption_kms_key

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output