Trial Component

class smexperiments.trial_component.TrialComponent(sagemaker_boto_client, **kwargs)

Bases: smexperiments._base_types.Record

This class represents a SageMaker trial component object.

A trial component is a stage in a trial.

Trial components are created automatically within the SageMaker runtime and may not be created directly. To automatically associate trial components with a trial and experiment supply an experiment config when creating a job. For example: https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTrainingJob.html

trial_component_name

The name of the trial component. Generated by SageMaker from the name of the source job with a suffix specific to the type of source job.

Type:str
trial_component_arn

The ARN of the trial component.

Type:str
display_name

The name of the trial component that will appear in UI, such as SageMaker Studio.

Type:str
source

A TrialComponentSource object with a source_arn attribute.

Type:obj
status

Status of the source job.

Type:str
start_time

When the source job started.

Type:datetime
end_time

When the source job ended.

Type:datetime
creation_time

When the source job was created.

Type:datetime
created_by

Contextual info on which account created the trial component.

Type:obj
last_modified_time

When the trial component was last modified.

Type:datetime
last_modified_by

Contextual info on which account last modified the trial component.

Type:obj
parameters

Dictionary of parameters to the source job.

Type:dict
input_artiacts

Dictionary of input artifacts.

Type:dict
output_artiacts

Dictionary of output artifacts.

Type:dict
metrics

Aggregated metrics for the job.

Type:obj
trial_component_name = None
trial_component_arn = None
display_name = None
source = None
status = None
start_time = None
end_time = None
creation_time = None
created_by = None
last_modified_time = None
last_modified_by = None
parameters = None
input_artifacts = None
output_artifacts = None
metrics = None
save()

Save the state of this TrialComponent to SageMaker.

delete()

Delete this TrialComponent from SageMaker.

classmethod load(trial_component_name, sagemaker_boto_client=None)

Load an existing trial component and return an TrialComponent object representing it.

Parameters:
  • trial_component_name (str) – Name of the trial component
  • sagemaker_boto_client (SageMaker.Client, optional) – Boto3 client for SageMaker. If not supplied, a default boto3 client will be created and used.
Returns:

A SageMaker TrialComponent object

Return type:

smexperiments.trial_component.TrialComponent

classmethod create(trial_component_name, display_name=None, sagemaker_boto_client=None)

Create a trial component and return a TrialComponent object representing it.

Returns:
A SageMaker TrialComponent
object.
Return type:smexperiments.trial_component.TrialComponent
classmethod list(source_arn=None, created_before=None, created_after=None, sort_by=None, sort_order=None, sagemaker_boto_client=None, trial_name=None, experiment_name=None, max_results=None, next_token=None)

Return a list of trial component summaries.

Parameters:
  • source_arn (str, optional) – A SageMaker Training or Processing Job ARN.
  • created_before (datetime.datetime, optional) – Return trial components created before this instant.
  • created_after (datetime.datetime, optional) – Return trial components created after this instant.
  • sort_by (str, optional) – Which property to sort results by. One of ‘SourceArn’, ‘CreatedBefore’, ‘CreatedAfter’
  • sort_order (str, optional) – One of ‘Ascending’, or ‘Descending’.
  • sagemaker_boto_client (SageMaker.Client, optional) – Boto3 client for SageMaker. If not supplied, a default boto3 client will be created and used.
  • trial_name (str, optional) – If provided only trial components related to the trial are returned.
  • experiment_name (str, optional) – If provided only trial components related to the experiment are returned.
  • max_results (int, optional) – maximum number of trial components to retrieve
  • next_token (str, optional) – token for next page of results
Returns:

An iterator

over TrialComponentSummary objects.

Return type:

collections.Iterator[smexperiments.api_types.TrialComponentSummary]