Migrate, Monitor, and Retrain SageMaker Models in Snowflake

In this hands-on lab, you'll take an XGBoost model trained in SageMaker and bring it into Snowflake. You'll use the Model Registry for governance, run batch inference via SQL, track model health with ML Observability, and perform retraining and promotion with warehouse compute.
-
Phase 1: Model Development & SageMaker Integration
- Train an XGBoost classifier on the mortgage data, then register it in Snowflake’s Model Registry. You can do this in whichever environment you prefer:
- AWS SageMaker - built-in estimator →
log_model(), - Azure ML - train with the v1 SDK, serialize via
joblib.dump(), thenRegistry.log_model(). - Vertex AI - train XGBoost in Vertex AI Workbench, register in Snowflake, batch-score.
- AWS SageMaker - built-in estimator →
- Once registered, perform batch-scoring on historical mortgage data in Snowflake.
- Train an XGBoost classifier on the mortgage data, then register it in Snowflake’s Model Registry. You can do this in whichever environment you prefer:
-
Phase 2: Model Monitoring with Snowflake ML Observability
- Configure Snowflake ML Observability to baseline, monitor performance, and detect drift
- Configure Snowflake Alerts to send email notification for performance degradation
- Generate custom performance reports and visualizations
-
Phase 3: End-to-End Model Retraining in Snowflake ML
- Preprocess updated training data using Snowpark ML (e.g. OneHotEncoder)
- Register features and entities in the Snowflake Feature Store
- Train a new binary classification model natively in Snowflake
- Log the new model version to the Snowflake Model Registry
- Use Snowflake ML Explainability to interpret the model
- Monitor drift with Snowflake ML Observability between V1 and V2
- Promote V2 to production using model version aliases
- Run version-agnostic batch scoring or inference in Snowflake warehouses using the PRODUCTION alias
Snowflake Environment:
- Account with ACCOUNTADMIN privileges to create:
- Databases, schemas, warehouses, and stages
- Service user (mlops_user) with key-pair authentication
- Email notification integration
- See detailed setup instructions
AWS SageMaker:
- Access to SE-Sandbox or equivalent environment
- JupyterLab space with SageMaker Distribution 3.3.1
- Important: Always STOP your JupyterLab space when not actively working and DELETE it after completing the lab
- See detailed setup instructions
Optional: Azure Machine Learning
- Azure ML workspace with a Compute Instance
- Python 3.10 – AzureML kernel
- Azure ML SDK v1 installed in your kernel
- See detailed setup instructions
Optional: Vertex AI
- Vertex AI Workbench instance (Python 3 kernel) in the same GCP project
- Vertex AI and Cloud Storage APIs enabled
- See detailed setup instructions
Required Files
- Data Files:
- Mortgage_Data.csv (for initial model training)
- NewTrainingData.csv (for model retraining)
Configuration Files:
- connections.toml (Snowflake connection config)
- rsa_private_key.pem (for secure authentication)
- environment.yaml (for Phase 3 SPCS packages)
- College-of-AI-MLOPsExerciseNotebook.ipynb (SageMaker notebook)
- MLOPs Snowflake ML Observability In Action Exercise.ipynb (Snowflake notebook)
- MLOPs End-to-End Snowflake ML Retraining Exercise.ipynb (Snowflake notebook)
Notebook Environments
- Phase 1:
- AWS SageMaker JupyterLab with Python 3.8+ or
- Azure ML Compute Instance with Python 3.10 – AzureML kernel or
- Vertex AI Workbench (Python 3 kernel)
- Phase 2: Snowflake Notebooks with Warehouse Runtime
- Phase 3: Snowflake Notebooks with Container Runtime (Snowflake ML Runtime CPU 1.0)
To receive credit for completing this HOL, you must successfully complete all DORA evaluations:
- SEAI50: Confirms SageMaker model registration in Snowflake
- SEAI51: Confirms batch inference completion
- SEAI52: Verifies ML Observability setup
- SEAI53: Confirms Model Version V2 registration
- SEAI54: Verifies PRODUCTION alias assignment to V2
- Snowflake Model Registry Documentation
- Snowflake ML Observability Documentation
- Inference in Snowflake Warehouses Documentation
- Snowpark ML Documentation
- Snowflake Feature Store Documentation
- Snowflake ML Explainability Documentation
Created by: SE Enablement (Diana Shaw) | Last Updated: June 18, 2025