Sm Model Governance Model Card With Model Package
Amazon SageMaker Model Governance - Model Cards Model Registry integration
This notebook's CI test result for us-west-2 is as follows. CI test results in other regions can be found at the end of the notebook.
This notebook walks you through the new feature of Amazon SageMaker Model Cards Model Registry Integration. To learn about the existing features and for more information on model cards, see Model Cards in the Amazon SageMaker Developer Guide.
Amazon SageMaker Model Cards give you the ability to create a centralized, customizable fact-sheet to document critical details about your machine learning (ML) models. Use model cards to keep a record of model information, such as intended uses, risk ratings, training details, evaluation metrics, and more for streamlined governance and reporting.
In this example, you will create a model package along with a model card to document model package details along the way. Learn how to create a model card by associating model package using the Amazon SageMaker Python SDK.
Contents
Setup
To begin, you must specify the following information:
- The IAM role ARN used to give SageMaker training and hosting access to your data. The following example uses the SageMaker execution role.
- The SageMaker session used to manage interactions with Amazon SageMaker Model Card API methods.
- The S3 URI (
bucketandprefix) where you want to store training artifacts, models, and any exported model card PDFs. This S3 bucket should be in the same Region as your Notebook Instance, training, and hosting configurations. The following example uses the default SageMaker S3 bucket and creates a default SageMaker S3 bucket if one does not already exist. - The S3 session used to manage interactions with Amazon S3 storage.
Next, import the necessary Python libraries.
2. Create a training job
Train a binary classification model with the training data from the previous step.
2. Create a model package
1. Collect model package details
Automatically collect basic model package information like model package ARN, model package group name, model package approval status, and model package's inference specification information.
2. Initialize a model card
Initialize a model card with the model package details collected in the previous step. When associating model package to a model card, model card will try to auto discover information like training job details and evaluation job details only if there are information like model artifacts and model metrics available in model package. Additionally, it will also try to carry over some additional information like business details to this model card from the previously created the most recent model card that is associated with this particular model package group.
Information inheritance
Additionally, new model card will also try to carry over some additional information like business details, intended uses, additional information to this model card from the previously created the most recent model card that is associated with this particular model package group. In this example, check out the intended uses that is automatically carried over from the previous model card.
Notebook CI Test Results
This notebook was tested in multiple regions. The test results are as follows, except for us-west-2 which is shown at the top of the notebook.