sagemaker.core.model_monitor.utils#
Placeholder docstring
Functions
|
Create an Amazon SageMaker monitoring schedule. |
Deletes a monitoring schedule. |
|
Calls the DescribeMonitoringSchedule API for given name and returns the response. |
|
|
Lists the alert history associated with the given schedule_name and alert_name. |
|
Lists the monitoring alerts associated with the given monitoring_schedule_name. |
|
Lists the monitoring executions associated with the given monitoring_schedule_name. |
|
Lists the monitoring executions associated with the given monitoring_schedule_name. |
Starts a monitoring schedule. |
|
Stops a monitoring schedule. |
|
Update the monitoring alerts associated with the given schedule_name and alert_name |
|
|
Update an Amazon SageMaker monitoring schedule. |
- sagemaker.core.model_monitor.utils.boto_create_monitoring_schedule(sagemaker_session, monitoring_schedule_name, schedule_expression, statistics_s3_uri, constraints_s3_uri, monitoring_inputs, monitoring_output_config, instance_count, instance_type, volume_size_in_gb, volume_kms_key=None, image_uri=None, entrypoint=None, arguments=None, record_preprocessor_source_uri=None, post_analytics_processor_source_uri=None, max_runtime_in_seconds=None, environment=None, network_config=None, role_arn=None, tags=None, data_analysis_start_time=None, data_analysis_end_time=None)[source]#
Create an Amazon SageMaker monitoring schedule.
- Parameters:
monitoring_schedule_name (str) – The name of the monitoring schedule. The name must be unique within an AWS Region in an AWS account. Names should have a minimum length of 1 and a maximum length of 63 characters.
schedule_expression (str) – The cron expression that dictates the monitoring execution schedule.
statistics_s3_uri (str) – The S3 uri of the statistics file to use.
constraints_s3_uri (str) – The S3 uri of the constraints file to use.
monitoring_inputs ([dict]) – List of MonitoringInput dictionaries.
monitoring_output_config (dict) – A config dictionary, which contains a list of MonitoringOutput dictionaries, as well as an optional KMS key ID.
instance_count (int) – The number of instances to run.
instance_type (str) – The type of instance to run.
volume_size_in_gb (int) – Size of the volume in GB.
volume_kms_key (str) – KMS key to use when encrypting the volume.
image_uri (str) – The image uri to use for monitoring executions.
entrypoint (str) – The entrypoint to the monitoring execution image.
arguments (str) – The arguments to pass to the monitoring execution image.
record_preprocessor_source_uri (str or None) – The S3 uri that points to the script that pre-processes the dataset (only applicable to first-party images).
post_analytics_processor_source_uri (str or None) – The S3 uri that points to the script that post-processes the dataset (only applicable to first-party images).
max_runtime_in_seconds (int) – Specifies a limit to how long the processing job can run, in seconds.
environment (dict) – Environment variables to start the monitoring execution container with.
network_config (dict) – Specifies networking options, such as network traffic encryption between processing containers, whether to allow inbound and outbound network calls to and from processing containers, and VPC subnets and security groups to use for VPC-enabled processing jobs.
role_arn (str) – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.
tags (Optional[Tags]) – A list of dictionaries containing key-value pairs.
data_analysis_start_time (str) – Start time for the data analysis window for the one time monitoring schedule (NOW), e.g. “-PT1H”
data_analysis_end_time (str) – End time for the data analysis window for the one time monitoring schedule (NOW), e.g. “-PT1H”
- sagemaker.core.model_monitor.utils.boto_delete_monitoring_schedule(sagemaker_session, monitoring_schedule_name)[source]#
Deletes a monitoring schedule.
- Parameters:
monitoring_schedule_name (str) – The name of the Amazon SageMaker Monitoring Schedule to delete.
- sagemaker.core.model_monitor.utils.boto_describe_monitoring_schedule(sagemaker_session, monitoring_schedule_name)[source]#
Calls the DescribeMonitoringSchedule API for given name and returns the response.
- Parameters:
monitoring_schedule_name (str) – The name of the processing job to describe.
- Returns:
A dictionary response with the processing job description.
- Return type:
dict
- sagemaker.core.model_monitor.utils.boto_list_monitoring_alert_history(sagemaker_session, monitoring_schedule_name: str | None = None, monitoring_alert_name: str | None = None, sort_by: str | None = 'CreationTime', sort_order: str | None = 'Descending', next_token: str | None = None, max_results: int | None = 10, creation_time_before: str | None = None, creation_time_after: str | None = None, status_equals: str | None = None) Dict[source]#
Lists the alert history associated with the given schedule_name and alert_name.
- Parameters:
monitoring_schedule_name (Optional[str]) – The name of the monitoring_schedule_name to filter on. If not provided, does not filter on it. Default: None.
monitoring_alert_name (Optional[str]) – The name of the monitoring_alert_name to filter on. If not provided, does not filter on it. Default: None.
sort_by (Optional[str]) – sort_by (str): The field to sort by. Can be one of: “Name”, “CreationTime” Default: “CreationTime”.
sort_order (Optional[str]) – The sort order. Can be one of: “Ascending”, “Descending”. Default: “Descending”.
next_token (Optional[str]) – The pagination token. Default: None
max_results (Optional[int]) – The maximum number of results to return. Must be between 1 and 100. Default: 10.
creation_time_before (Optional[str]) – A filter to filter alert history before a time
creation_time_after (Optional[str]) – A filter to filter alert history after a time Default: None.
status_equals (Optional[str]) – A filter to filter alert history by status Default: None.
- Returns:
list of monitoring alert history.
- Return type:
dict
- sagemaker.core.model_monitor.utils.boto_list_monitoring_alerts(sagemaker_session, monitoring_schedule_name: str, next_token: str | None = None, max_results: int | None = 10) Dict[source]#
Lists the monitoring alerts associated with the given monitoring_schedule_name.
- Parameters:
monitoring_schedule_name (str) – The name of the monitoring schedule to filter on. If not provided, does not filter on it.
next_token (Optional[str]) – The pagination token. Default: None
max_results (Optional[int]) – The maximum number of results to return. Must be between 1 and 100. Default: 10
- Returns:
list of monitoring alerts.
- Return type:
dict
- sagemaker.core.model_monitor.utils.boto_list_monitoring_executions(sagemaker_session, monitoring_schedule_name, sort_by='ScheduledTime', sort_order='Descending', max_results=100)[source]#
Lists the monitoring executions associated with the given monitoring_schedule_name.
- Parameters:
monitoring_schedule_name (str) – The monitoring_schedule_name for which to retrieve the monitoring executions.
sort_by (str) – The field to sort by. Can be one of: “CreationTime”, “ScheduledTime”, “Status”. Default: “ScheduledTime”.
sort_order (str) – The sort order. Can be one of: “Ascending”, “Descending”. Default: “Descending”.
max_results (int) – The maximum number of results to return. Must be between 1 and 100.
- Returns:
Dictionary of monitoring schedule executions.
- Return type:
dict
- sagemaker.core.model_monitor.utils.boto_list_monitoring_schedules(sagemaker_session, endpoint_name=None, sort_by='CreationTime', sort_order='Descending', max_results=100)[source]#
Lists the monitoring executions associated with the given monitoring_schedule_name.
- Parameters:
endpoint_name (str) – The name of the endpoint to filter on. If not provided, does not filter on it. Default: None.
sort_by (str) – The field to sort by. Can be one of: “Name”, “CreationTime”, “Status”. Default: “CreationTime”.
sort_order (str) – The sort order. Can be one of: “Ascending”, “Descending”. Default: “Descending”.
max_results (int) – The maximum number of results to return. Must be between 1 and 100.
- Returns:
Dictionary of monitoring schedule executions.
- Return type:
dict
- sagemaker.core.model_monitor.utils.boto_start_monitoring_schedule(sagemaker_session, monitoring_schedule_name)[source]#
Starts a monitoring schedule.
- Parameters:
monitoring_schedule_name (str) – The name of the Amazon SageMaker Monitoring Schedule to start.
- sagemaker.core.model_monitor.utils.boto_stop_monitoring_schedule(sagemaker_session, monitoring_schedule_name)[source]#
Stops a monitoring schedule.
- Parameters:
monitoring_schedule_name (str) – The name of the Amazon SageMaker Monitoring Schedule to stop.
- sagemaker.core.model_monitor.utils.boto_update_monitoring_alert(sagemaker_session, monitoring_schedule_name: str, monitoring_alert_name: str, data_points_to_alert: int, evaluation_period: int)[source]#
Update the monitoring alerts associated with the given schedule_name and alert_name
- Parameters:
monitoring_schedule_name (str) – The name of the monitoring schedule to update.
monitoring_alert_name (str) – The name of the monitoring alert to update.
data_points_to_alert (int) – The data point to alert.
evaluation_period (int) – The period to evaluate the alert status.
- Returns:
A dict represents the update alert response.
- Return type:
dict
- sagemaker.core.model_monitor.utils.boto_update_monitoring_schedule(sagemaker_session, monitoring_schedule_name, schedule_expression=None, statistics_s3_uri=None, constraints_s3_uri=None, monitoring_inputs=None, monitoring_output_config=None, instance_count=None, instance_type=None, volume_size_in_gb=None, volume_kms_key=None, image_uri=None, entrypoint=None, arguments=None, record_preprocessor_source_uri=None, post_analytics_processor_source_uri=None, max_runtime_in_seconds=None, environment=None, network_config=None, role_arn=None, data_analysis_start_time=None, data_analysis_end_time=None)[source]#
Update an Amazon SageMaker monitoring schedule.
- Parameters:
monitoring_schedule_name (str) – The name of the monitoring schedule. The name must be unique within an AWS Region in an AWS account. Names should have a minimum length of 1 and a maximum length of 63 characters.
schedule_expression (str) – The cron expression that dictates the monitoring execution schedule.
statistics_s3_uri (str) – The S3 uri of the statistics file to use.
constraints_s3_uri (str) – The S3 uri of the constraints file to use.
monitoring_inputs ([dict]) – List of MonitoringInput dictionaries.
monitoring_output_config (dict) – A config dictionary, which contains a list of MonitoringOutput dictionaries, as well as an optional KMS key ID.
instance_count (int) – The number of instances to run.
instance_type (str) – The type of instance to run.
volume_size_in_gb (int) – Size of the volume in GB.
volume_kms_key (str) – KMS key to use when encrypting the volume.
image_uri (str) – The image uri to use for monitoring executions.
entrypoint (str) – The entrypoint to the monitoring execution image.
arguments (str) – The arguments to pass to the monitoring execution image.
record_preprocessor_source_uri (str or None) – The S3 uri that points to the script that pre-processes the dataset (only applicable to first-party images).
post_analytics_processor_source_uri (str or None) – The S3 uri that points to the script that post-processes the dataset (only applicable to first-party images).
max_runtime_in_seconds (int) – Specifies a limit to how long the processing job can run, in seconds.
environment (dict) – Environment variables to start the monitoring execution container with.
network_config (dict) – Specifies networking options, such as network traffic encryption between processing containers, whether to allow inbound and outbound network calls to and from processing containers, and VPC subnets and security groups to use for VPC-enabled processing jobs.
role_arn (str) – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.
tags ([dict[str,str]]) – A list of dictionaries containing key-value pairs.
data_analysis_start_time (str) – Start time for the data analysis window for the one time monitoring schedule (NOW), e.g. “-PT1H”
data_analysis_end_time (str) – End time for the data analysis window for the one time monitoring schedule (NOW), e.g. “-PT1H”