createAutoMLJob method

Future<CreateAutoMLJobResponse> createAutoMLJob({
  1. required String autoMLJobName,
  2. required List<AutoMLChannel> inputDataConfig,
  3. required AutoMLOutputDataConfig outputDataConfig,
  4. required String roleArn,
  5. AutoMLJobConfig? autoMLJobConfig,
  6. AutoMLJobObjective? autoMLJobObjective,
  7. bool? generateCandidateDefinitionsOnly,
  8. ProblemType? problemType,
  9. List<Tag>? tags,
})

Creates an Autopilot job.

Find the best performing model after you run an Autopilot job by calling . Deploy that model by following the steps described in Step 6.1: Deploy the Model to Amazon SageMaker Hosting Services.

For information about how to use Autopilot, see Automate Model Development with Amazon SageMaker Autopilot.

May throw ResourceInUse. May throw ResourceLimitExceeded.

Parameter autoMLJobName : Identifies an Autopilot job. Must be unique to your account and is case-insensitive.

Parameter inputDataConfig : Similar to InputDataConfig supported by Tuning. Format(s) supported: CSV. Minimum of 500 rows.

Parameter outputDataConfig : Similar to OutputDataConfig supported by Tuning. Format(s) supported: CSV.

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

Parameter autoMLJobConfig : Contains CompletionCriteria and SecurityConfig.

Parameter autoMLJobObjective : Defines the objective of a an AutoML job. You provide a AutoMLJobObjective$MetricName and Autopilot infers whether to minimize or maximize it. If a metric is not specified, the most commonly used ObjectiveMetric for problem type is automaically selected.

Parameter generateCandidateDefinitionsOnly : Generates possible candidates without training a model. A candidate is a combination of data preprocessors, algorithms, and algorithm parameter settings.

Parameter problemType : Defines the kind of preprocessing and algorithms intended for the candidates. Options include: BinaryClassification, MulticlassClassification, and Regression.

Parameter tags : Each tag consists of a key and an optional value. Tag keys must be unique per resource.

Implementation

Future<CreateAutoMLJobResponse> createAutoMLJob({
  required String autoMLJobName,
  required List<AutoMLChannel> inputDataConfig,
  required AutoMLOutputDataConfig outputDataConfig,
  required String roleArn,
  AutoMLJobConfig? autoMLJobConfig,
  AutoMLJobObjective? autoMLJobObjective,
  bool? generateCandidateDefinitionsOnly,
  ProblemType? problemType,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(autoMLJobName, 'autoMLJobName');
  _s.validateStringLength(
    'autoMLJobName',
    autoMLJobName,
    1,
    32,
    isRequired: true,
  );
  ArgumentError.checkNotNull(inputDataConfig, 'inputDataConfig');
  ArgumentError.checkNotNull(outputDataConfig, 'outputDataConfig');
  ArgumentError.checkNotNull(roleArn, 'roleArn');
  _s.validateStringLength(
    'roleArn',
    roleArn,
    20,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateAutoMLJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AutoMLJobName': autoMLJobName,
      'InputDataConfig': inputDataConfig,
      'OutputDataConfig': outputDataConfig,
      'RoleArn': roleArn,
      if (autoMLJobConfig != null) 'AutoMLJobConfig': autoMLJobConfig,
      if (autoMLJobObjective != null)
        'AutoMLJobObjective': autoMLJobObjective,
      if (generateCandidateDefinitionsOnly != null)
        'GenerateCandidateDefinitionsOnly': generateCandidateDefinitionsOnly,
      if (problemType != null) 'ProblemType': problemType.toValue(),
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateAutoMLJobResponse.fromJson(jsonResponse.body);
}