createAutoMLJobV2 method

Future<CreateAutoMLJobV2Response> createAutoMLJobV2({
  1. required List<AutoMLJobChannel> autoMLJobInputDataConfig,
  2. required String autoMLJobName,
  3. required AutoMLProblemTypeConfig autoMLProblemTypeConfig,
  4. required AutoMLOutputDataConfig outputDataConfig,
  5. required String roleArn,
  6. AutoMLComputeConfig? autoMLComputeConfig,
  7. AutoMLJobObjective? autoMLJobObjective,
  8. AutoMLDataSplitConfig? dataSplitConfig,
  9. ModelDeployConfig? modelDeployConfig,
  10. AutoMLSecurityConfig? securityConfig,
  11. List<Tag>? tags,
})

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

May throw ResourceInUse. May throw ResourceLimitExceeded.

Parameter autoMLJobInputDataConfig : 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.

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

Parameter autoMLProblemTypeConfig : Defines the configuration settings of one of the supported problem types.

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

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

Parameter autoMLComputeConfig : Specifies the compute configuration for the AutoML job V2.

Parameter autoMLJobObjective : 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.

Parameter dataSplitConfig : 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.

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

Parameter securityConfig : The security configuration for traffic encryption or Amazon VPC settings.

Parameter tags : 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.

Implementation

Future<CreateAutoMLJobV2Response> createAutoMLJobV2({
  required List<AutoMLJobChannel> autoMLJobInputDataConfig,
  required String autoMLJobName,
  required AutoMLProblemTypeConfig autoMLProblemTypeConfig,
  required AutoMLOutputDataConfig outputDataConfig,
  required String roleArn,
  AutoMLComputeConfig? autoMLComputeConfig,
  AutoMLJobObjective? autoMLJobObjective,
  AutoMLDataSplitConfig? dataSplitConfig,
  ModelDeployConfig? modelDeployConfig,
  AutoMLSecurityConfig? securityConfig,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateAutoMLJobV2'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AutoMLJobInputDataConfig': autoMLJobInputDataConfig,
      'AutoMLJobName': autoMLJobName,
      'AutoMLProblemTypeConfig': autoMLProblemTypeConfig,
      'OutputDataConfig': outputDataConfig,
      'RoleArn': roleArn,
      if (autoMLComputeConfig != null)
        'AutoMLComputeConfig': autoMLComputeConfig,
      if (autoMLJobObjective != null)
        'AutoMLJobObjective': autoMLJobObjective,
      if (dataSplitConfig != null) 'DataSplitConfig': dataSplitConfig,
      if (modelDeployConfig != null) 'ModelDeployConfig': modelDeployConfig,
      if (securityConfig != null) 'SecurityConfig': securityConfig,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateAutoMLJobV2Response.fromJson(jsonResponse.body);
}