CertSafari
    Snowflake SnowPro Advanced: Data Scientist (DSA-C03)· Lessons

    Domain 1 · Lesson 3/16

    The machine learning lifecycle: stages from data collection to monitoring

    Summarize the machine learning lifecycle.

    18 min read
    4.25% of exam
    9 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Put the ML lifecycle stages in order and explain why each stage depends on the one before it
    • Explain why training data is frozen as a versioned Snowflake Dataset and why runs are recorded in experiments
    • Explain why held-out evaluation and explainability come before deployment, and why accuracy alone can mislead
    • Explain how model versioning and per-version monitoring make a deployed model traceable and close the loop back to retraining

    Key concept

    ML lifecycle as a chain of stages — The ML lifecycle is an ordered chain of stages: collect, explore, engineer features, train, evaluate, explain, deploy, version and monitor. Each stage takes the previous stage's output as its input, so a defect left in one stage is carried into every stage after it.

    1.The lifecycle as an ordered chain

    A machine learning model is the end product of a pipeline. Raw data is collected, explored, turned into features, used to train candidate models, scored, explained, deployed, versioned and then watched in production. Snowflake ML puts all of these stages on one platform: you prepare data, build features in the Feature Store, train models, compare them in experiments, deploy through the Model Registry and monitor them with ML Observability. ML Lineage follows the artifacts from source data through features and datasets to models, which is how a problem in a production model gets traced back to the stage that caused it.

    The order matters because every stage consumes what the previous one produced. Features can only be computed from data you have already collected and understood. A model can only be trained on features that already exist. Deployment should only happen after a model has been scored, and monitoring needs something deployed to watch. Bad data does not go away later. A skewed sample becomes a skewed feature, then a model that has learned the skew, then a production service that applies it to every request.

    Lifecycle stages in order, what each one hands to the next, and the Snowflake ML capability that supports it
    StageHands forwardSnowflake ML capability
    1. Collect dataRaw data in governed tablesPrepare data
    2. Explore and visualizeAn understanding of the data, with quality problems foundSnowflake Notebooks
    3. Engineer featuresModel-ready inputs that are defined onceSnowflake Feature Store
    4. TrainCandidate modelsContainer Runtime
    5. Evaluate (gate)Scores on held-out data, used to pick the best runExperiments
    6. ExplainEvidence that the model is right for the right reasonsML Explainability
    7. Deploy and versionA traceable model version serving inferenceSnowflake Model Registry
    8. Monitor and re-evaluateDrift and performance signals that trigger retrainingML Observability

    Checkpoint 1 of 9· Put it in order

    A team is building a fraud model in Snowflake ML. Put these lifecycle stages in the order they must run, given that each stage uses the previous stage's output.

    1. 1.Evaluate the candidates on held-out data and pick the best run
    2. 2.Engineer model-ready features in the Feature Store
    3. 3.Train candidate models on those features
    4. 4.Monitor the deployed version for drift and performance with ML Observability
    5. 5.Deploy the chosen model as a version in the Model Registry
    6. 6.Collect the raw transaction data and explore it for quality problems

    Checkpoint 2 of 9· Exam question

    A team is building a churn model on Snowflake. Which sequence places the lifecycle stages in the correct order, from the first step to the last?

    Sources1

    2.Collecting, exploring and freezing the training data

    Data collection comes first because every later stage works from the data it gathers. For a churn model, that means usage and billing history together with the outcome you want to predict. Snowflake ML runs on top of your governed data, so the data you collect stays on the same platform where you will train and serve the model, and you do not have to export it anywhere.

    Exploration and visualization come next. They answer one question: is this data fit to learn from? Profiling distributions, plotting relationships and finding missing or inconsistent values all have to happen before features are built, because a problem found after training means going back to rebuild the features and train again. Exploring also cannot come before collecting, because you can only explore data you already have. The techniques themselves belong to exploratory data analysis. In the lifecycle, the point is where exploration sits: after collection and before features.

    After the data is prepared, freeze it. A training run you cannot reproduce is a training run you cannot audit or debug. If the source table changes overnight, retraining on the "same" query quietly trains on different rows. Snowflake Datasets fix this by capturing the training data as an immutable, file-based snapshot with a name and a version. Retraining v2 of a model on Dataset version v1 gives exactly the rows that v1 was trained on. You create a Dataset from Feature Store output with the generate_dataset method, which takes a required name and an optional version. Its sibling, generate_training_set, can write a materialized table instead, but a materialized table can still change and carries less metadata.

    Checkpoint 3 of 9· Check yourself

    Your team is collecting usage and billing history, along with the churn outcome, for a new churn model built with Snowflake ML. Where does that collected data need to be for the later stages (training and serving)?

    Sources12

    3.Feature engineering, training and experiment tracking

    Feature engineering turns the explored data into the inputs a model learns from. The lifecycle risk here is defining a feature twice: once in the training notebook and again in the production scoring code. If the two definitions drift apart, the model is served inputs that differ from the ones it learned on. This is training-serving skew. The Feature Store: entities and feature views removes that risk by defining each feature pipeline once and serving the same definition to both training and inference. The transformations themselves can be open-source preprocessors for prototyping, Snowflake ML preprocessors that push work down to the warehouse for large production datasets, or Ray map_batches for custom large-scale processing.

    Training runs in Container Runtime, a pre-built ML environment in Snowflake Notebooks. It comes with packages such as PyTorch, XGBoost and scikit-learn already installed, and it supports distributed training and hyperparameter tuning. Training rarely produces one model. It produces many candidates with different algorithms, parameters and feature sets, and the lifecycle needs a reliable way to choose between them.

    Experiment tracking provides that. An experiment records each training run's parameters and metrics, so runs can be compared directly instead of from memory or scattered notebook output. In Snowsight, the runs list shows each run's name, status and creation date, with a column for each metric, and you can add parameters as extra columns. You can select up to five runs and open a comparison view that shows their metadata, parameters, metrics and linked model versions next to each other. Finishing a run makes it immutable, so the record you used to choose the winner cannot be edited afterwards. You can also upload metadata and artifacts from training done elsewhere, which lets older runs be compared with new ones.

    Checkpoint 4 of 9· Check yourself

    A churn model scored well when its runs were compared, but its predictions are noticeably worse in production. The cause turns out to be the tenure feature: the training notebook computes it one way, and the production scoring code computes it slightly differently. What is the problem, and what fixes it?

    Sources134

    4.Evaluation and explainability: the gates before deployment

    Evaluation is a gate. A model goes on to deployment only after it has been scored on data it never saw during training. Snowflake's classification function, for example, holds out a random sample, trains a new model without those rows, and then predicts on them. The details of the metrics belong to Confusion matrix, accuracy, precision and recall. Passing the gate depends on choosing the metric that measures what the business actually cares about.

    A confusion matrix counts four outcomes: true positives (TP), false positives (FP), false negatives (FN) and true negatives (TN). A good model puts as many cases as possible on the diagonal (TP and TN) and as few as possible off it. Three metrics are calculated from these counts, and each has a different denominator:

    • Accuracy = (TP + TN) / all predictions
    • Precision = TP / (TP + FP), the share of flagged cases that were truly positive
    • Recall = TP / (TP + FN), the share of actual positives the model caught

    Take a churn model scored on 1,000 customers with TP = 80, FP = 20, FN = 40 and TN = 860. The model flagged 100 customers, and 80 of them really churned, so precision is 80/100 = 0.80. There were 120 actual churners, and the model caught 80, so recall is 80/120 ≈ 0.67. One third of the churners were missed. Accuracy is 940/1,000 = 0.94, which looks better than either metric because the 860 true negatives count towards it.

    Explainability comes between evaluation and deployment. A model can score well and still be right for the wrong reasons, for example by relying on a hidden bias or a column that leaks the answer. Regulated industries such as finance and healthcare may require evidence that the model gets correct results for the right reasons before it goes live. The Model Registry's explain method returns per-feature contributions based on Shapley values and the model explain method. Read before deployment, they show which features are driving the predictions and whether those are features that should drive them.

    Checkpoint 5 of 9· Check yourself

    Before going live, a bank's credit-default model has passed the evaluation gate with strong precision and recall on held-out data. A regulator now asks for evidence that it reaches its predictions for the right reasons, not through a hidden bias or a column that leaks the answer. What should the team do before deploying?

    Checkpoint 6 of 9· Exam question

    A fraud model scores card transactions where only 0.4% are fraudulent. A candidate model that labels every transaction as legitimate reports 99.6% accuracy on the test set. Which evaluation approach is MOST appropriate for judging whether the model is useful?

    Checkpoint 7 of 9· Exam question

    A binary churn classifier is evaluated on 1,000 customers and produces this confusion matrix: TP = 80, FP = 20, FN = 40, TN = 860. Which interpretation is correct?

    Sources56

    5.Deployment and model versioning

    Deployment in Snowflake starts by logging the trained model in the Snowflake Model Registry. Once a model is logged, you call its methods to run inference in a virtual warehouse, or you serve it from Snowpark Container Services for GPU inference. Inference can be called from Python, from SQL or through REST API endpoints.

    Logging a model version with a comment, metrics and sample input datapython
    from snowflake.ml.model import task, type_hints
    mv = reg.log_model(clf,
                       model_name="my_model",
                       version_name="v1",
                       conda_dependencies=["scikit-learn"],
                       comment="My awesome ML model",
                       metrics={"score": 96},
                       sample_input_data=train_features,
                       task=task.Task.TABULAR_BINARY_CLASSIFICATION)

    Versioning is what makes each deployed model traceable. Each log_model call adds one version, and the combination of model name and version name must be unique within the schema. To publish a retrained model you call log_model again with the same model_name and a new version_name. The full mechanics belong to Model Registry: logging versions with metadata. For the lifecycle, what matters is that the metrics and comment logged with v1 stay attached to v1, and v1 stays in the registry after v2 arrives. If v2 performs badly, v1 is still there and unchanged, so you can point inference back at it.

    Checkpoint 8 of 9· Fill the gap

    In this Model Registry call, the blanked argument is the one you change, while keeping model_name the same, to publish a retrained model as a new version that sits alongside v1. Which argument is it?

    from snowflake.ml.model import task, type_hints
    mv = reg.log_model(clf,
                       model_name="my_model",
                        ? ="v1",
                       conda_dependencies=["scikit-learn"],
                       comment="My awesome ML model",
                       metrics={"score": 96},
                       sample_input_data=train_features,
                       task=task.Task.TABULAR_BINARY_CLASSIFICATION)

    Sources7

    6.Monitoring and the loop back to retraining

    Monitoring is a lifecycle stage of its own, not a check you run once at launch, because a deployed model's behaviour changes after it ships. Inputs drift away from the training data, assumptions made at training time go stale, and data pipelines break. The causes of data drift and model decay are covered elsewhere. In the lifecycle, drift is the signal that sends you back to collecting fresh data, rebuilding features and retraining. That retrained model then goes through evaluation, versioning and deployment again.

    A model monitor sits after deployment and watches one specific version in production. Each model version can have exactly one monitor, and a monitor cannot be shared between versions. When v2 replaces v1, v2 needs its own monitor. The monitor reads the stored inference logs, which hold features, predictions and ground-truth labels. It aggregates them over a window of at least one day and can compare them with an optional baseline table to measure drift. Its Snowsight dashboard plots performance metrics over time, chosen by model type: precision and recall for classifiers, RMSE or MAE for regression models. This is where post-deployment evaluation happens. When the same metric that passed the gate before launch starts to fall on live data, it is time to retrain.

    Checkpoint 9 of 9· Check yourself

    The monitor dashboard for fraud model v1 shows its recall falling week after week on live data. The team retrains the model, logs it as v2 and moves inference over to v2. What has to happen before v2's live performance is tracked?

    Sources89

    Sources

    (9)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Use ML Lineage to track the source data to features, datasets, and models throughout your ML pipeline”
      ↩︎ The lifecycle as an ordered chain
      “Create experiments to evaluate your trained models against set metrics”
      ↩︎ The lifecycle as an ordered chain
      “Monitor your production models with ML Observability and Explainability”
      ↩︎ The lifecycle as an ordered chain
      “Snowflake ML is an integrated set of capabilities for end-to-end machine learning in a single platform on top of your governed data.”
      ↩︎ Collecting, exploring and freezing the training data
      “ensures consistency between training and inference to reduce training-serving skew”
      ↩︎ Feature engineering, training and experiment tracking
      “ML training in Snowflake runs in Container Runtime, a pre-built ML environment optimized for efficient data loading”
      ↩︎ Feature engineering, training and experiment tracking
      “Experiments help you select the best model for your use case to bring live to production.”
      ↩︎ Feature engineering, training and experiment tracking
      “Use ML Lineage to track the source data to features, datasets, and models throughout your ML pipeline”
      ↩︎ Key concept
      “From a natural language prompt, CoCo can explore data, engineer features, train and evaluate models, debug issues, and prepare models for deployment.”
      ↩︎ Prediction
      “ML Lineage is a capability to trace end-to-end lineage of ML artifacts from source data to features, datasets, and models.”
      ↩︎ Checkpoint
    2. 2.
      “Snowflake Datasets provide an immutable, file-based snapshot of data, which helps to ensure model reproducibility”
      ↩︎ Collecting, exploring and freezing the training data
      “have limited metadata support. If you require these features, consider using Snowflake Datasets instead.”
      ↩︎ Collecting, exploring and freezing the training data
      “the key differences are the required name argument, optional version argument, and additional metadata fields”
      ↩︎ Collecting, exploring and freezing the training data
      “Snowflake Datasets provide an immutable, file-based snapshot of data, which helps to ensure model reproducibility”
      ↩︎ Exam trap 4
    3. 3.
      “Snowflake ML Preprocessors - For larger datasets, use Snowflake ML's preprocessing APIs that execute natively on the Snowflake platform.”
      ↩︎ Feature engineering, training and experiment tracking
    4. 4.
      “Completing a run makes it immutable and presents it as finished in Snowsight.”
      ↩︎ Feature engineering, training and experiment tracking
      “The runs list displays Run name, Status, Created date, and a column for each metric.”
      ↩︎ Feature engineering, training and experiment tracking
      “You can select up to five runs in your experiment.”
      ↩︎ Feature engineering, training and experiment tracking
    5. 5.
      “A new model is trained without these rows, and then the rows are used as inference input.”
      ↩︎ Evaluation and explainability: the gates before deployment
      “The objective is to maximize the number of instances on the diagonal of the matrix while minimizing the number of off-diagonal instances.”
      ↩︎ Evaluation and explainability: the gates before deployment
      “Precision: The ratio of true positives to the total predicted positives.”
      ↩︎ Evaluation and explainability: the gates before deployment
      “Recall (Sensitivity): The ratio of true positives to the total actual positives.”
      ↩︎ Evaluation and explainability: the gates before deployment
      “This metric can be misleading in unbalanced cases.”
      ↩︎ Exam trap 1
      “Recall (Sensitivity): The ratio of true positives to the total actual positives.”
      ↩︎ Exam trap 2
      “This metric can be misleading in unbalanced cases.”
      ↩︎ Prediction
    6. 6.
      “might require stronger evidence that the model is producing the correct results for the right reasons.”
      ↩︎ Evaluation and explainability: the gates before deployment
      “The black box model can also conceal implicit biases and fail to establish clear reasons for decisions.”
      ↩︎ Evaluation and explainability: the gates before deployment
      “Models with explainability have a method named explain that returns the Shapley values for the model’s features.”
      ↩︎ Checkpoint
      “Since model versions are immutable, you must create a new model version to add explainability to an existing model.”
      ↩︎ Prediction
    7. 7.
      “After training your model, operationalizing the model and running inference in Snowflake starts with logging the model in the Snowflake Model Registry.”
      ↩︎ Deployment and model versioning
      “Serves models and runs distributed inference at scale using Python, SQL, or REST API endpoints.”
      ↩︎ Deployment and model versioning
      “To log additional versions of the model, call log_model again with the same model_name but a different version_name.”
      ↩︎ Deployment and model versioning
      “The combination of name and version must be unique in the schema.”
      ↩︎ Deployment and model versioning
    8. 8.
      “Model behavior can change over time due to input drift, stale training assumptions, and data pipeline issues”
      ↩︎ Monitoring and the loop back to retraining
      “Each model version can have exactly one monitor, and each monitor can monitor exactly one model version; they cannot be shared.”
      ↩︎ Monitoring and the loop back to retraining
      “An optional baseline table for comparative metric operations such as drift.”
      ↩︎ Monitoring and the loop back to retraining
      “Each model version can have exactly one monitor, and each monitor can monitor exactly one model version; they cannot be shared.”
      ↩︎ Exam trap 3

    Ready to test yourself?

    Practise the 16 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.