Analytics — sagemaker 2.247.0 documentation (original) (raw)

class sagemaker.analytics.AnalyticsMetricsBase

Bases: object

Base class for tuning job or training job analytics classes.

Understands common functionality like persistence and caching.

Initializes AnalyticsMetricsBase instance.

export_csv(filename)

Persists the analytics dataframe to a file.

Parameters:

filename (str) – The name of the file to save to.

dataframe(force_refresh=False)

A pandas dataframe with lots of interesting results about this object.

Created by calling SageMaker List and Describe APIs and converting them into a convenient tabular summary.

Parameters:

force_refresh (bool) – Set to True to fetch the latest data from SageMaker API.

clear_cache()

Clear the object of all local caches of API methods.

So that the next time any properties are accessed they will be refreshed from the service.

class sagemaker.analytics.HyperparameterTuningJobAnalytics(hyperparameter_tuning_job_name, sagemaker_session=None)

Bases: AnalyticsMetricsBase

Fetch results about a hyperparameter tuning job and make them accessible for analytics.

Initialize a HyperparameterTuningJobAnalytics instance.

Parameters:

property name

Name of the HyperparameterTuningJob being analyzed

clear_cache()

Clear the object of all local caches of API methods.

property tuning_ranges

A dictionary describing the ranges of all tuned hyperparameters.

The keys are the names of the hyperparameter, and the values are the ranges.

The output can take one of two forms:

For more details about the ‘TrainingJobDefinition’ and ‘TrainingJobDefinitions’ fields in job description, seehttps://botocore.readthedocs.io/en/latest/reference/services/sagemaker.html#SageMaker.Client.create_hyper_parameter_tuning_job

description(force_refresh=False)

Call DescribeHyperParameterTuningJob for the hyperparameter tuning job.

Parameters:

force_refresh (bool) – Set to True to fetch the latest data from SageMaker API.

Returns:

The Amazon SageMaker response forDescribeHyperParameterTuningJob.

Return type:

dict

training_job_summaries(force_refresh=False)

A (paginated) list of everything from ListTrainingJobsForTuningJob.

Parameters:

force_refresh (bool) – Set to True to fetch the latest data from SageMaker API.

Returns:

The Amazon SageMaker response forListTrainingJobsForTuningJob.

Return type:

dict

class sagemaker.analytics.TrainingJobAnalytics(training_job_name, metric_names=None, sagemaker_session=None, start_time=None, end_time=None, period=None)

Bases: AnalyticsMetricsBase

Fetch training curve data from CloudWatch Metrics for a specific training job.

Initialize a TrainingJobAnalytics instance.

Parameters:

CLOUDWATCH_NAMESPACE = '/aws/sagemaker/TrainingJobs'

property name

Name of the TrainingJob being analyzed

clear_cache()

Clear the object of all local caches of API methods.

This is so that the next time any properties are accessed they will be refreshed from the service.

class sagemaker.analytics.ExperimentAnalytics(experiment_name=None, search_expression=None, sort_by=None, sort_order=None, metric_names=None, parameter_names=None, sagemaker_session=None, input_artifact_names=None, output_artifact_names=None)

Bases: AnalyticsMetricsBase

Fetch trial component data and make them accessible for analytics.

Initialize a ExperimentAnalytics instance.

Parameters:

MAX_TRIAL_COMPONENTS = 10000

property name

Name of the Experiment being analyzed.

clear_cache()

Clear the object of all local caches of API methods.