This module creates SageMaker Model Monitoring jobs for (optionally) data quality, model quality, model bias, and model explainability. It requires a deployed model endpoint and the proper check steps for each monitoring job:
- Data Quality: QualityCheck step
- Model Quality: QualityCheck step
- Model Bias: ClarifyCheck step
- Model Explainability: ClarifyCheck step
Note that updating parameters will require replacing resources. Deployments may be delayed until any running monitoring jobs complete (and the resources can be destroyed).
endpoint-name
: The name of the endpoint used to run the monitoring job.security-group-id
: The VPC security group IDs, should provide access to the givensubnet-ids
.subnet-ids
: The ID of the subnets in the VPC to which you want to connect your training job or model.model-package-arn
: Model package ARNmodel-bucket-arn
: S3 bucket ARN for model artifactskms-key-id
: The KMS key used to encrypted storage and output.
One or more of:
enable-data-quality-monitor
: True to enable the data quality monitoring job.enable-model-quality-monitor
: True to enable the model quality monitoring job.enable-model-bias-monitor
: True to enable the model bias monitoring job.enable-model-explainability-monitor
: True to enable the model explainability monitoring job.
sagemaker-project-id
: SageMaker project idsagemaker-project-name
: SageMaker project name
Each job has prefixed parameters, some of which are required. E.g. if
enable-data-quality-monitor
is set to true
, then the
data-quality-checkstep-output-prefix
parameter is required.
*-checkstep-output-prefix
: The S3 prefix inmodel-artifacts-bucket-arn
which contains the output from the corresponding Check step in the SageMaker Pipeline.*-output-prefix
: The S3 prefix inmodel-artifacts-bucket-arn
to contain the output of the monitoring job.
*-instance-count
: The number of ML compute instances to use in the model monitoring job.*-instance-type
: The ML compute instance type for the processing job.*-instance-volume-size-in-gb
: The size of the ML storage volume, in gigabytes, that you want to provision.*-max-runtime-in-seconds
: The maximum length of time, in seconds, the monitoring job can run before it is stopped.*-schedule-expression
: A cron expression that describes details about the monitoring schedule.
See below for the specific input parameters for each model monitoring job. These parameters are all required.
N/A
model-quality-problem-type
: The machine learning problem type of the model that the monitoring job monitors.
model-quality-inference-attribute
: The attribute of the input data that represents the ground truth label.model-quality-probability-attribute
: In a classification problem, the attribute that represents the class probability.model-quality-probability-threshold-attribute
: The threshold for the class probability to be evaluated as a positive result.
model-bias-checkstep-analysis-config-prefix
: The S3 prefix inmodel-artifacts-bucket-arn
which contains the output from the Clarify Check Step used for model bias.model-bias-features-attribute
: The attributes of the input data that are the input features.model-bias-inference-attribute
: The attribute of the input data that represents the ground truth label.model-bias-probability-attribute
: In a classification problem, the attribute that represents the class probability.model-bias-probability-threshold-attribute
: The threshold for the class probability to be evaluated as a positive result.
model-explainability-checkstep-analysis-config-prefix
: The S3 prefix inmodel-artifacts-bucket-arn
which contains the output from the Clarify Check Step used for model explainability.model-explainability-features-attribute
: The attributes of the input data that are the input features.model-explainability-inference-attribute
: The attribute of the input data that represents the ground truth label.model-explainability-probability-attribute
: In a classification problem, the attribute that represents the class probability.
name: monitoring
path: modules/sagemaker/sagemaker-model-monitoring
parameters:
- name: sagemaker_project_id
value: dummy123
- name: sagemaker_project_name
value: dummy123
- name: model_package_arn
value: arn:aws:sagemaker:<region>:<account>:model-package/<package_name>/1
- name: model_bucket_arn
value: arn:aws:s3:::<bucket name>
- name: enable-data-quality-monitor
value: True
- name: data-quality-checkstep-output-prefix
value: model-training-run-1234/dataqualitycheckstep
- name: data-quality-output-prefix
value: model-training-run-1234/monitor/dataqualityoutput
- name: endpoint_name
valueFrom:
moduleMetadata:
group: endpoints
name: endpoint
key: EndpointName
- name: security_group_id
valueFrom:
moduleMetadata:
group: endpoints
name: endpoint
key: SecurityGroupId
- name: kms_key_id
valueFrom:
moduleMetadata:
group: endpoints
name: endpoint
key: KmsKeyId
- name: subnet_ids
valueFrom:
moduleMetadata:
group: networking
name: networking
key: PrivateSubnetIds
ModelExecutionRoleArn
: SageMaker Model Execution IAM role ARNModelName
: SageMaker Model nameModelPackageArn
: SageMaker Model package ARNEndpointName
: SageMaker Endpoint nameEndpointUrl
: SageMaker Endpoint Url
N/A