Skip to content

create_auto_ml_job_v2 async

create_auto_ml_job_v2(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    auto_ml_job_name: Optional[AutoMLJobName] = None,
    auto_ml_job_input_data_config: Optional[AutoMLJobInputDataConfig] = None,
    output_data_config: Optional[AutoMLOutputDataConfig] = None,
    auto_ml_problem_type_config: Optional[AutoMLProblemTypeConfig] = None,
    role_arn: Optional[RoleArn] = None,
    tags: Optional[TagList] = None,
    security_config: Optional[AutoMLSecurityConfig] = None,
    auto_ml_job_objective: Optional[AutoMLJobObjective] = None,
    model_deploy_config: Optional[ModelDeployConfig] = None,
    data_split_config: Optional[AutoMLDataSplitConfig] = None,
    auto_ml_compute_config: Optional[AutoMLComputeConfig] = None,
) -> CreateAutoMLJobV2Response

Creates an Autopilot job also referred to as Autopilot experiment or AutoML job V2.

An AutoML job in SageMaker AI is a fully automated process that allows you to build machine learning models with minimal effort and machine learning expertise. When initiating an AutoML job, you provide your data and optionally specify parameters tailored to your use case. SageMaker AI then automates the entire model development lifecycle, including data preprocessing, model training, tuning, and evaluation. AutoML jobs are designed to simplify and accelerate the model building process by automating various tasks and exploring different combinations of machine learning algorithms, data preprocessing techniques, and hyperparameter values. The output of an AutoML job comprises one or more trained models ready for deployment and inference. Additionally, SageMaker AI AutoML jobs generate a candidate model leaderboard, allowing you to select the best-performing model for deployment.

For more information about AutoML jobs, see https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development.html in the SageMaker AI developer guide.

AutoML jobs V2 support various problem types such as regression, binary, and multiclass classification with tabular data, text and image classification, time-series forecasting, and fine-tuning of large language models (LLMs) for text generation.

CreateAutoMLJobV2 and DescribeAutoMLJobV2 are new versions of CreateAutoMLJob and DescribeAutoMLJob which offer backward compatibility.

CreateAutoMLJobV2 can manage tabular problem types identical to those of its previous version CreateAutoMLJob, as well as time-series forecasting, non-tabular problem types such as image or text classification, and text generation (LLMs fine-tuning).

Find guidelines about how to migrate a CreateAutoMLJob to CreateAutoMLJobV2 in Migrate a CreateAutoMLJob to CreateAutoMLJobV2.

For the list of available problem types supported by CreateAutoMLJobV2, see AutoMLProblemTypeConfig.

You can find the best-performing model after you run an AutoML job V2 by calling DescribeAutoMLJobV2.

Parameters:

  • auto_ml_job_name (Optional[AutoMLJobName], default: None ) –

    Identifies an Autopilot job. The name must be unique to your account and is case insensitive.

  • auto_ml_job_input_data_config (Optional[AutoMLJobInputDataConfig], default: None ) –

    An array of channel objects describing the input data and their location. Each channel is a named input source. Similar to the InputDataConfig attribute in the CreateAutoMLJob input parameters. The supported formats depend on the problem type:

    • For tabular problem types: S3Prefix, ManifestFile.

    • For image classification: S3Prefix, ManifestFile, AugmentedManifestFile.

    • For text classification: S3Prefix.

    • For time-series forecasting: S3Prefix.

    • For text generation (LLMs fine-tuning): S3Prefix.

  • output_data_config (Optional[AutoMLOutputDataConfig], default: None ) –

    Provides information about encryption and the Amazon S3 output path needed to store artifacts from an AutoML job.

  • auto_ml_problem_type_config (Optional[AutoMLProblemTypeConfig], default: None ) –

    Defines the configuration settings of one of the supported problem types.

  • role_arn (Optional[RoleArn], default: None ) –

    The ARN of the role that is used to access the data.

  • tags (Optional[TagList], default: None ) –

    An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, such as by purpose, owner, or environment. For more information, see Tagging Amazon Web ServicesResources. Tag keys must be unique per resource.

  • security_config (Optional[AutoMLSecurityConfig], default: None ) –

    The security configuration for traffic encryption or Amazon VPC settings.

  • auto_ml_job_objective (Optional[AutoMLJobObjective], default: None ) –

    Specifies a metric to minimize or maximize as the objective of a job. If not specified, the default objective metric depends on the problem type. For the list of default values per problem type, see AutoMLJobObjective.

    • For tabular problem types: You must either provide both the AutoMLJobObjective and indicate the type of supervised learning problem in AutoMLProblemTypeConfig (TabularJobConfig.ProblemType), or none at all.

    • For text generation problem types (LLMs fine-tuning): Fine-tuning language models in Autopilot does not require setting the AutoMLJobObjective field. Autopilot fine-tunes LLMs without requiring multiple candidates to be trained and evaluated. Instead, using your dataset, Autopilot directly fine-tunes your target model to enhance a default objective metric, the cross-entropy loss. After fine-tuning a language model, you can evaluate the quality of its generated text using different metrics. For a list of the available metrics, see Metrics for fine-tuning LLMs in Autopilot.

  • model_deploy_config (Optional[ModelDeployConfig], default: None ) –

    Specifies how to generate the endpoint name for an automatic one-click Autopilot model deployment.

  • data_split_config (Optional[AutoMLDataSplitConfig], default: None ) –

    This structure specifies how to split the data into train and validation datasets.

    The validation and training datasets must contain the same headers. For jobs created by calling CreateAutoMLJob, the validation dataset must be less than 2 GB in size.

    This attribute must not be set for the time-series forecasting problem type, as Autopilot automatically splits the input dataset into training and validation sets.

  • auto_ml_compute_config (Optional[AutoMLComputeConfig], default: None ) –

    Specifies the compute configuration for the AutoML job V2.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_auto_ml_job_v2(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    auto_ml_job_name: Optional[
        "capo_sagemaker.types.auto_ml_job_name.AutoMLJobName"
    ] = None,
    auto_ml_job_input_data_config: Optional[
        "capo_sagemaker.types.auto_ml_job_input_data_config.AutoMLJobInputDataConfig"
    ] = None,
    output_data_config: Optional[
        "capo_sagemaker.types.auto_ml_output_data_config.AutoMLOutputDataConfig"
    ] = None,
    auto_ml_problem_type_config: Optional[
        "capo_sagemaker.types.auto_ml_problem_type_config.AutoMLProblemTypeConfig"
    ] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    security_config: Optional[
        "capo_sagemaker.types.auto_ml_security_config.AutoMLSecurityConfig"
    ] = None,
    auto_ml_job_objective: Optional[
        "capo_sagemaker.types.auto_ml_job_objective.AutoMLJobObjective"
    ] = None,
    model_deploy_config: Optional[
        "capo_sagemaker.types.model_deploy_config.ModelDeployConfig"
    ] = None,
    data_split_config: Optional[
        "capo_sagemaker.types.auto_ml_data_split_config.AutoMLDataSplitConfig"
    ] = None,
    auto_ml_compute_config: Optional[
        "capo_sagemaker.types.auto_ml_compute_config.AutoMLComputeConfig"
    ] = None,
) -> (
    "capo_sagemaker.types.create_auto_ml_job_v2_response.CreateAutoMLJobV2Response"
):
    """<p>Creates an Autopilot job also referred to as Autopilot experiment or AutoML job V2.</p> <p>An AutoML job in SageMaker AI is a fully automated process that allows you to build machine learning models with minimal effort and machine learning expertise. When initiating an AutoML job, you provide your data and optionally specify parameters tailored to your use case. SageMaker AI then automates the entire model development lifecycle, including data preprocessing, model training, tuning, and evaluation. AutoML jobs are designed to simplify and accelerate the model building process by automating various tasks and exploring different combinations of machine learning algorithms, data preprocessing techniques, and hyperparameter values. The output of an AutoML job comprises one or more trained models ready for deployment and inference. Additionally, SageMaker AI AutoML jobs generate a candidate model leaderboard, allowing you to select the best-performing model for deployment.</p> <p>For more information about AutoML jobs, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development.html">https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development.html</a> in the SageMaker AI developer guide.</p> <p>AutoML jobs V2 support various problem types such as regression, binary, and multiclass classification with tabular data, text and image classification, time-series forecasting, and fine-tuning of large language models (LLMs) for text generation.</p> <note> <p> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJobV2.html">CreateAutoMLJobV2</a> and <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html">DescribeAutoMLJobV2</a> are new versions of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJob.html">CreateAutoMLJob</a> and <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJob.html">DescribeAutoMLJob</a> which offer backward compatibility.</p> <p> <code>CreateAutoMLJobV2</code> can manage tabular problem types identical to those of its previous version <code>CreateAutoMLJob</code>, as well as time-series forecasting, non-tabular problem types such as image or text classification, and text generation (LLMs fine-tuning).</p> <p>Find guidelines about how to migrate a <code>CreateAutoMLJob</code> to <code>CreateAutoMLJobV2</code> in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-create-experiment.html#autopilot-create-experiment-api-migrate-v1-v2">Migrate a CreateAutoMLJob to CreateAutoMLJobV2</a>.</p> </note> <p>For the list of available problem types supported by <code>CreateAutoMLJobV2</code>, see <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLProblemTypeConfig.html">AutoMLProblemTypeConfig</a>.</p> <p>You can find the best-performing model after you run an AutoML job V2 by calling <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html">DescribeAutoMLJobV2</a>.</p>

    Args:
        auto_ml_job_name: <p>Identifies an Autopilot job. The name must be unique to your account and is case insensitive.</p>
        auto_ml_job_input_data_config: <p>An array of channel objects describing the input data and their location. Each channel is a named input source. Similar to the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJob.html#sagemaker-CreateAutoMLJob-request-InputDataConfig">InputDataConfig</a> attribute in the <code>CreateAutoMLJob</code> input parameters. The supported formats depend on the problem type:</p> <ul> <li> <p>For tabular problem types: <code>S3Prefix</code>, <code>ManifestFile</code>.</p> </li> <li> <p>For image classification: <code>S3Prefix</code>, <code>ManifestFile</code>, <code>AugmentedManifestFile</code>.</p> </li> <li> <p>For text classification: <code>S3Prefix</code>.</p> </li> <li> <p>For time-series forecasting: <code>S3Prefix</code>.</p> </li> <li> <p>For text generation (LLMs fine-tuning): <code>S3Prefix</code>.</p> </li> </ul>
        output_data_config: <p>Provides information about encryption and the Amazon S3 output path needed to store artifacts from an AutoML job.</p>
        auto_ml_problem_type_config: <p>Defines the configuration settings of one of the supported problem types.</p>
        role_arn: <p>The ARN of the role that is used to access the data.</p>
        tags: <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, such as by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web ServicesResources</a>. Tag keys must be unique per resource.</p>
        security_config: <p>The security configuration for traffic encryption or Amazon VPC settings.</p>
        auto_ml_job_objective: <p>Specifies a metric to minimize or maximize as the objective of a job. If not specified, the default objective metric depends on the problem type. For the list of default values per problem type, see <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobObjective.html">AutoMLJobObjective</a>.</p> <note> <ul> <li> <p>For tabular problem types: You must either provide both the <code>AutoMLJobObjective</code> and indicate the type of supervised learning problem in <code>AutoMLProblemTypeConfig</code> (<code>TabularJobConfig.ProblemType</code>), or none at all.</p> </li> <li> <p>For text generation problem types (LLMs fine-tuning): Fine-tuning language models in Autopilot does not require setting the <code>AutoMLJobObjective</code> field. Autopilot fine-tunes LLMs without requiring multiple candidates to be trained and evaluated. Instead, using your dataset, Autopilot directly fine-tunes your target model to enhance a default objective metric, the cross-entropy loss. After fine-tuning a language model, you can evaluate the quality of its generated text using different metrics. For a list of the available metrics, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-llms-finetuning-metrics.html">Metrics for fine-tuning LLMs in Autopilot</a>.</p> </li> </ul> </note>
        model_deploy_config: <p>Specifies how to generate the endpoint name for an automatic one-click Autopilot model deployment.</p>
        data_split_config: <p>This structure specifies how to split the data into train and validation datasets.</p> <p>The validation and training datasets must contain the same headers. For jobs created by calling <code>CreateAutoMLJob</code>, the validation dataset must be less than 2 GB in size.</p> <note> <p>This attribute must not be set for the time-series forecasting problem type, as Autopilot automatically splits the input dataset into training and validation sets.</p> </note>
        auto_ml_compute_config: <p>Specifies the compute configuration for the AutoML job V2.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_auto_ml_job_v2_request.CreateAutoMLJobV2Request]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_auto_ml_job_v2_response.CreateAutoMLJobV2Response"
    ]:
        import capo_sagemaker._operations.sage_maker.create_auto_ml_job_v2

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_auto_ml_job_v2.async_create_auto_ml_job_v2(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAutoMLJobV2")
    )
    input_: capo_sagemaker.types.create_auto_ml_job_v2_request.CreateAutoMLJobV2Request = {}
    if auto_ml_job_name is not None:
        input_["auto_ml_job_name"] = auto_ml_job_name
    if auto_ml_job_input_data_config is not None:
        input_["auto_ml_job_input_data_config"] = auto_ml_job_input_data_config
    if output_data_config is not None:
        input_["output_data_config"] = output_data_config
    if auto_ml_problem_type_config is not None:
        input_["auto_ml_problem_type_config"] = auto_ml_problem_type_config
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if tags is not None:
        input_["tags"] = tags
    if security_config is not None:
        input_["security_config"] = security_config
    if auto_ml_job_objective is not None:
        input_["auto_ml_job_objective"] = auto_ml_job_objective
    if model_deploy_config is not None:
        input_["model_deploy_config"] = model_deploy_config
    if data_split_config is not None:
        input_["data_split_config"] = data_split_config
    if auto_ml_compute_config is not None:
        input_["auto_ml_compute_config"] = auto_ml_compute_config

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