What you will be able to do
- Decide whether a data science workload is supervised or unsupervised by asking whether each training row already holds the answer
- Pick an estimator whose type matches the label: a regressor for a continuous number, a classifier for a set of classes
- Tell a model's learned parameters apart from the configuration you choose before training
- Recognise unsupervised workloads such as clustering and unlabelled outlier detection, and prepare features for distance-based clustering
- Explain how reinforcement learning differs from the other two, and why a table of past outcomes is not a reward signal
Key concept
Labelled vs unlabelled training rows — Supervised learning trains on rows that already hold the answer in a target column, so its predictions can be checked against that answer. Unsupervised learning gets no answer column and has to find structure, such as groups or outliers, by itself.
1.Labelled rows mean supervised learning
One question sorts most machine learning workloads: does each training row already have the answer? If it does, the answer sits in a target column, also called the label, and the workload is supervised. The model learns how the feature columns map to that label. It then predicts the label for new rows where nobody knows the answer yet. Customer churn, credit card fraud and spam are the standard examples. Each has a history in which the outcome was eventually recorded for every row.
Snowflake's classification function shows the pattern clearly. A suitable training set has a target column with the labeled class of every row and at least one feature column. You name that column when you create the model. In the example below, label is a Boolean that records whether a user went on to purchase, and user_interest_score and user_rating are the features.
CREATE OR REPLACE SNOWFLAKE.ML.CLASSIFICATION model_binary(
INPUT_DATA => SYSTEM$REFERENCE('view', 'binary_classification_view'),
TARGET_COLNAME => 'label'
);Once trained, the model's PREDICT method fills in labels for a second table that has the same features but no label column. The labels are also what make a supervised model measurable. To evaluate it, Snowflake trains an additional model with some labelled rows withheld. It then predicts those rows and compares the predicted classes with the actual ones. No comparison like this exists without a label to compare against.
The rule depends on how the history was recorded, not on how the business problem is phrased. Take a churn table where a CHURNED flag was filled in 90 days after every account closed or renewed. Every row carries its outcome. That makes it a plain supervised classification problem, so nothing has to be pseudo-labelled, and no semi-supervised workaround is needed. Clustering the same customers would give you groups, but not a churn probability. Groups found without the label never learned what churn looks like.
Checkpoint 1 of 7· Fill the gap
This statement trains a supervised binary classifier on binary_classification_view, which has the columns user_interest_score, user_rating and label. Which column belongs in the blank?
CREATE OR REPLACE SNOWFLAKE.ML.CLASSIFICATION model_binary(
INPUT_DATA => SYSTEM$REFERENCE('view', 'binary_classification_view'),
TARGET_COLNAME => ' ? '
);TARGET_COLNAME names the column that already holds the known answer for every training row. Here that is the Boolean label column, which records whether each user went on to purchase. user_interest_score and user_rating are the feature columns, and the model learns how they map to that label.
Source: docs.snowflake.comCheckpoint 2 of 7· Exam question
A telecom provider keeps three years of customer records in Snowflake. A CHURNED column was filled in 90 days after each account closed or renewed. The team wants a model that scores today's active customers by cancellation risk. Which learning paradigm fits MOST directly?
Correct answer: C — Supervised classification, since every historical row carries a known churn label the model can learn to predict from account features.
- A. Clustering finds similar groups but never learns a mapping to a known outcome, so its output is a segment id and not a calibrated churn probability.
- B. Reinforcement learning needs an agent that acts in an environment and learns from feedback to its own choices. A static table of past outcomes has no such interaction loop.
- C. A labeled binary outcome plus input features is the textbook supervised classification setup, and the fitted model can then score current accounts.
- D. Semi-supervised learning targets cases where labels are scarce. Here every historical row is labeled, so no pseudo-labeling step is needed.
Sources1
2.What training learns and what you choose
Training a model fits its parameters to the data: the coefficients of a linear model, the weights of a neural network, the split points of a tree. They are outputs, not settings. Snowflake's classification function says so outright: the model is fitted to the training data you provide, and its model parameters can't be specified or adjusted by hand. The function is powered by a gradient boosting machine, and you can't choose or change that algorithm either. What you do control is the configuration: which data goes in, which column is the target, and, in Python libraries, which estimator to use and any hyperparameters set before fitting.
The difference has a practical result. A trained model is its parameters, and those parameters came from one specific dataset. So when the data changes, you don't edit the model. Classification and anomaly detection models are immutable: to update one, you drop it and train a new one, usually with CREATE OR REPLACE.
The type of the label decides which supervised estimator to configure. When the target is a category such as purchase or no purchase, you need a classifier. Classification only makes sense when the label's cardinality is greater than one and less than the number of rows, and Snowflake's function caps it at 255 distinct classes. A duration in minutes breaks that idea: nearly every row would become its own class, and two adjacent minutes would count as completely different answers. A continuous number calls for a regressor. In snowflake.ml.modeling, the label is passed in the same way for both: label_cols names the answer column and input_cols names the features.
from snowflake.ml.modeling.xgboost import XGBRegressor
regressor = XGBRegressor(
input_cols=feature_columns,
label_cols=["ETA_MINUTES"],
output_cols=["predicted_eta"]
)
regressor.fit(train_df)Unsupervised tools don't fit this task, however you configure them. KMeans and PCA never receive the label column, so nothing they learn is tuned to predict minutes. A cluster's average or a first principal component is a summary of the features, not a fitted prediction of the target.
| Item | Chosen before training or learned? | Example |
|---|---|---|
| Target column | Chosen | TARGET_COLNAME => 'label', label_cols=["ETA_MINUTES"] |
| Feature columns | Chosen | input_cols=feature_columns |
| Estimator or algorithm | Chosen in Python libraries; fixed in the classification function | XGBRegressor, XGBClassifier; gradient boosting machine |
| Model parameters | Learned by fit / CREATE | Can't be set by hand in the classification function |
Checkpoint 3 of 7· Check yourself
A churn model built with SNOWFLAKE.ML.CLASSIFICATION was trained last quarter. A new quarter of labelled rows has arrived, and the team wants the model to reflect it and predict better. Which approach works?
Training learns a model's parameters from one specific dataset, so new data means training a new model. Classification models are immutable: you can't set their parameters, choose their algorithm or update them in place. You drop the model and retrain it, and CREATE OR REPLACE does that in one step.
“Models are immutable and cannot be updated in place. To update a model, drop the existing model and train a new one.”Source: docs.snowflake.com
Checkpoint 4 of 7· Exam question
A data scientist must predict the number of minutes each food delivery will take, using a labeled Snowflake table with distance, courier load and weather columns. Which snowflake.ml.modeling estimator choice is MOST appropriate for this target?
Correct answer: D — xgboost.XGBRegressor fitted on the features with the duration column as label, since the target is a continuous number.
- A. A classifier treats durations as unrelated categories, discards their ordering and cannot predict values missing from training, so it suits a continuous target poorly.
- B. KMeans is unsupervised and ignores the duration label during fitting. Its clusters are not optimized to predict the target, so it is not a proper regression approach.
- C. PCA is an unsupervised projection that maximizes variance, not agreement with the label. Its component is a rescaled mix of features and has no meaning as minutes.
- D. A continuous numeric label calls for supervised regression, and XGBRegressor learns that mapping and returns a predicted number of minutes for each delivery.
3.Unlabelled rows mean unsupervised learning
When no column holds the answer, the model has to find structure by itself, and the workload is unsupervised. Two shapes come up most often. Clustering groups similar rows. Outlier detection flags the rows that don't fit the pattern. Both are answers to "what is in this data?" rather than "what is the value of this known target?"
Customer segmentation is the classic clustering case. A retailer with two million loyalty-card customers and no segment labels wants natural groups based on purchase frequency, basket size and recency. A Snowpark ML KMeans model fits that task. Before fitting, the features need to be put on a common scale. One of the Snowflake guides scales its inputs with min-max scaling before KMeans, and snowflake.ml.modeling.preprocessing provides StandardScaler for the same job. Here is why: KMeans groups rows by distance. If you leave basket size in raw currency next to a visit count in single digits, basket size alone decides which rows sit close together. The scaler is fitted too, because it captures the global state of the training sample, such as each column's minimum and maximum.
With no labels, you can't score clusters as right or wrong. You compare candidate numbers of clusters with internal measures instead. The main ones are inertia, also called the within-cluster sum of squares, and the silhouette score, and you fit several values of k and compare them. Reusing an existing column as the answer quietly changes the paradigm. If you train on a loyalty tier, or on a "top-spending decile" flag, you get a supervised model of that column. It reproduces groups someone already defined; it doesn't discover new ones.
Outlier detection is unsupervised in its default form. Snowflake's anomaly detection function trains on a timestamp column and a target metric. With no label, it learns what normal looks like, forecasts the period it is checking, and flags the values that fall away from that forecast. Mean and median react differently to such values, as Normal vs skewed distributions; mean vs median under outliers explains. Finding the unusual points when nobody has marked them is the unsupervised part.
CREATE OR REPLACE SNOWFLAKE.ML.ANOMALY_DETECTION basic_model( INPUT_DATA => TABLE(view_with_training_data), TIMESTAMP_COLNAME => 'date', TARGET_COLNAME => 'sales', LABEL_COLNAME => '');The same function also supports a supervised, labelled approach. If you name a label column that marks the rows already known to be anomalies, the training becomes supervised. Calling a task "anomaly detection" doesn't fix its paradigm. The presence of labels does.
Checkpoint 5 of 7· Check yourself
Your daily compute-cost history has an IS_INCIDENT column. It marks the days that analysts later confirmed as anomalies. You pass that column as LABEL_COLNAME when you create a SNOWFLAKE.ML.ANOMALY_DETECTION model. What kind of training is this?
The presence of labels decides the paradigm, not the name of the task. If LABEL_COLNAME names a column that marks rows already known to be anomalies, the training is supervised. Only an empty LABEL_COLNAME gives unsupervised training.
“The purpose of the label column is to tell the model which rows are known anomalies.”Source: docs.snowflake.com
Checkpoint 6 of 7· Exam question
A retailer has no labeled segments for 2 million loyalty-card customers. Marketing wants natural groups based on purchase frequency, basket size and recency, with all three features on very different numeric scales. Which approach is MOST appropriate?
Correct answer: A — Standardize the three features, then fit snowflake.ml.modeling.cluster.KMeans and compare several values of k by inertia.
- A. KMeans is distance based, so features on different scales must be standardized first or the largest-scale column dominates. It needs no labels and k can be compared.
- B. Logistic regression is supervised and would only learn to separate the invented spend label. It cannot reveal a set of natural groups that were never labeled.
- C. Predicting an existing tier reproduces a business rule instead of discovering structure. The result would simply echo the labels that were supplied as ground truth.
- D. Skipping scaling lets the widest-range feature dominate Euclidean distance, so the groups reflect one column and not the combined purchasing behavior.
4.Rewards instead of rows: reinforcement learning
Reinforcement learning drops the training table altogether. An agent takes actions in an environment, receives a reward or a penalty after each one, and gradually learns a policy that earns more reward. Nobody hands it the correct action for a situation, which is how it differs from supervised learning. It isn't just looking for structure in a fixed dataset either, which is how it differs from unsupervised learning. It learns from the consequences of its own choices, so it needs a loop in which those choices change what happens next.
Snowflake's ML Functions all follow the table-in, prediction-out pattern. Forecasting predicts future metric values from past trends. Anomaly Detection flags values that differ from expectations. Classification sorts rows into classes. Top Insights finds dimensions that affect a metric in surprising ways. Each one trains on historical rows and returns predictions or insights. None of them takes an action and learns from a reward, and Snowflake ML has no dedicated reinforcement learning feature.
A history table full of outcomes can look like rewards, but it isn't. Suppose retention offers went out in the past and the cancellations that followed were recorded. That table is labelled data: each row pairs features with a known result, and a model learns from it by supervised training. Reinforcement learning would need the model itself to choose offers, see the response, and adjust. Past outcomes that someone else's decisions produced don't give it that loop.
| Paradigm | What the model learns from | Can it be scored against a known answer? | Snowflake example |
|---|---|---|---|
| Supervised | Rows with a target column (label) | Yes, by comparing predictions with actual labels on withheld rows | SNOWFLAKE.ML.CLASSIFICATION with TARGET_COLNAME |
| Unsupervised | Rows with no answer column | No; judged by internal measures such as within-cluster sum of squares | KMeans; ANOMALY_DETECTION with LABEL_COLNAME => '' |
| Reinforcement | Rewards for actions an agent takes | No fixed answer; judged by the reward earned | No ML Function takes actions or learns from rewards |
Checkpoint 7 of 7· Check yourself
Last year a telecom sent retention offers to some subscribers. For each one, it recorded whether that subscriber cancelled within 60 days. The team now wants to predict which subscribers will cancel. Which approach fits this data?
Outcomes recorded on historical rows are labels. Each row pairs features with a known result, so this is supervised training. Reinforcement learning would need an agent that picks the offers itself, sees the responses and adjusts, and no Snowflake ML Function takes actions or learns from rewards.
“Suitable training datasets for use with classification include a target column representing the labeled class of each data point and at least one feature column.”Source: docs.snowflake.com
Sources6
Sources
(6)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Common use cases of classification include customer churn prediction, credit card fraud detection, and spam detection.”
↩︎ Labelled rows mean supervised learning“a target column representing the labeled class of each data point”
↩︎ Labelled rows mean supervised learning“use its PREDICT method to infer labels for the unlabeled purchase data”
↩︎ Labelled rows mean supervised learning“the predicted classes are compared to the actual classes”
↩︎ Labelled rows mean supervised learning“The model is fitted to the provided training data.”
↩︎ What training learns and what you choose“You cannot choose or modify the classification algorithm.”
↩︎ What training learns and what you choose“Models are immutable and cannot be updated in place.”
↩︎ What training learns and what you choose“The cardinality of the label (target) column must be greater than one and less than the number of rows in the dataset.”
↩︎ What training learns and what you choose“a target column representing the labeled class of each data point”
↩︎ Key concept“Model parameters cannot be manually specified or adjusted.”
↩︎ Exam trap 3“Your target column must contain no more than 255 distinct classes.”
↩︎ Prediction“Models are immutable and cannot be updated in place. To update a model, drop the existing model and train a new one.”
↩︎ Checkpoint“Suitable training datasets for use with classification include a target column representing the labeled class of each data point and at least one feature column.”
↩︎ Checkpoint - 2.https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/built-in-models/snowpark-mlOfficial docs
“input_cols=input_cols, output_cols=output_cols, label_cols=label_cols, drop_input_cols=True”
↩︎ What training learns and what you choose - 3.https://www.snowflake.com/en/developers/guides/advanced-guide-to-snowflake-feature-storeSecondary source
“used in combination with different sets of model hyper-parameters”
↩︎ What training learns and what you choose“scale our input variables using min-max scaling”
↩︎ Unlabelled rows mean unsupervised learning“they capture the global state (e.g. minimum and maximum values for columns) of our training sample”
↩︎ Unlabelled rows mean unsupervised learning“Within-Cluster Sum of Squares”
↩︎ Unlabelled rows mean unsupervised learning - 4.
“Snowflake ML preprocessors handle distributed transformations directly within Snowflake.”
↩︎ Unlabelled rows mean unsupervised learning“The following code uses the StandardScaler and OneHotEncoder libraries.”
↩︎ Exam trap 4 - 5.
“Anomaly detection is the process of identifying outliers in data.”
↩︎ Unlabelled rows mean unsupervised learning“with a supervised (labeled) approach”
↩︎ Unlabelled rows mean unsupervised learning“The purpose of the label column is to tell the model which rows are known anomalies.”
↩︎ Exam trap 1“Because this example uses unsupervised training, you do not need to use the label column.”
↩︎ Prediction“The purpose of the label column is to tell the model which rows are known anomalies.”
↩︎ Checkpoint - 6.
“Forecasting predicts future metric values from past trends in time-series data.”
↩︎ Rewards instead of rows: reinforcement learning“Anomaly Detection flags metric values that differ from typical expectations.”
↩︎ Rewards instead of rows: reinforcement learning“Top Insights helps you find dimensions and values that affect the metric in surprising ways.”
↩︎ Rewards instead of rows: reinforcement learning“Classification sort rows into two or more classes based on their most predictive features.”
↩︎ Exam trap 2