createTrialComponent method

Future<CreateTrialComponentResponse> createTrialComponent({
  1. required String trialComponentName,
  2. String? displayName,
  3. DateTime? endTime,
  4. Map<String, TrialComponentArtifact>? inputArtifacts,
  5. MetadataProperties? metadataProperties,
  6. Map<String, TrialComponentArtifact>? outputArtifacts,
  7. Map<String, TrialComponentParameterValue>? parameters,
  8. DateTime? startTime,
  9. TrialComponentStatus? status,
  10. List<Tag>? tags,
})

Creates a trial component, which is a stage of a machine learning trial. A trial is composed of one or more trial components. A trial component can be used in multiple trials.

Trial components include pre-processing jobs, training jobs, and batch transform jobs.

When you use Amazon SageMaker Studio or the Amazon SageMaker Python SDK, all experiments, trials, and trial components are automatically tracked, logged, and indexed. When you use the AWS SDK for Python (Boto), you must use the logging APIs provided by the SDK.

You can add tags to a trial component and then use the Search API to search for the tags.

May throw ResourceLimitExceeded.

Parameter trialComponentName : The name of the component. The name must be unique in your AWS account and is not case-sensitive.

Parameter displayName : The name of the component as displayed. The name doesn't need to be unique. If DisplayName isn't specified, TrialComponentName is displayed.

Parameter endTime : When the component ended.

Parameter inputArtifacts : The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.

Parameter outputArtifacts : The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.

Parameter parameters : The hyperparameters for the component.

Parameter startTime : When the component started.

Parameter status : The status of the component. States include:

  • InProgress
  • Completed
  • Failed

Parameter tags : A list of tags to associate with the component. You can use Search API to search on the tags.

Implementation

Future<CreateTrialComponentResponse> createTrialComponent({
  required String trialComponentName,
  String? displayName,
  DateTime? endTime,
  Map<String, TrialComponentArtifact>? inputArtifacts,
  MetadataProperties? metadataProperties,
  Map<String, TrialComponentArtifact>? outputArtifacts,
  Map<String, TrialComponentParameterValue>? parameters,
  DateTime? startTime,
  TrialComponentStatus? status,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(trialComponentName, 'trialComponentName');
  _s.validateStringLength(
    'trialComponentName',
    trialComponentName,
    1,
    120,
    isRequired: true,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    1,
    120,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateTrialComponent'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TrialComponentName': trialComponentName,
      if (displayName != null) 'DisplayName': displayName,
      if (endTime != null) 'EndTime': unixTimestampToJson(endTime),
      if (inputArtifacts != null) 'InputArtifacts': inputArtifacts,
      if (metadataProperties != null)
        'MetadataProperties': metadataProperties,
      if (outputArtifacts != null) 'OutputArtifacts': outputArtifacts,
      if (parameters != null) 'Parameters': parameters,
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
      if (status != null) 'Status': status,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateTrialComponentResponse.fromJson(jsonResponse.body);
}