Analytics

class sagemaker.analytics.AnalyticsMetricsBase

Bases: object

Base class for tuning job or training job analytics classes. Understands common functionality like persistence and caching.

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: sagemaker.analytics.AnalyticsMetricsBase

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

Initialize a HyperparameterTuningJobAnalytics instance.

Parameters:
  • hyperparameter_tuning_job_name (str) – name of the HyperparameterTuningJob to analyze.
  • sagemaker_session (sagemaker.session.Session) – Session object which manages interactions with Amazon SageMaker APIs and any other AWS services needed. If not specified, one is created using the default AWS configuration chain.
name

Name of the HyperparameterTuningJob being analyzed

clear_cache()

Clear the object of all local caches of API methods.

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.

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 for DescribeHyperParameterTuningJob.
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 for ListTrainingJobsForTuningJob.
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: sagemaker.analytics.AnalyticsMetricsBase

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

Initialize a TrainingJobAnalytics instance.

Parameters:
  • training_job_name (str) – name of the TrainingJob to analyze.
  • metric_names (list, optional) – string names of all the metrics to collect for this training job. If not specified, then it will use all metric names configured for this job.
  • sagemaker_session (sagemaker.session.Session) – Session object which manages interactions with Amazon SageMaker APIs and any other AWS services needed. If not specified, one is specified using the default AWS configuration chain.
CLOUDWATCH_NAMESPACE = '/aws/sagemaker/TrainingJobs'
name

Name of the TrainingJob being analyzed

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.