Reading 2: Supervised and Unsupervised Learning

The difference between learning with a teacher and learning by exploring.

Supervised Learning

Supervised learning is the most widely deployed category of machine learning, and it is the one you have already seen in detail. Decision trees are a supervised learning method. So are the spam filters that protect your inbox, the voice recognition systems on your phone, the medical imaging tools that flag potential tumors, and most of the AI systems that make consequential decisions about people.

The defining feature of supervised learning is the presence of labels — known correct answers attached to the training examples. The learning algorithm is supervised in a specific sense: it can check its predictions against the correct answers and adjust accordingly. The labels provide the feedback signal that drives learning.

How Supervised Learning Works

The process follows a consistent pattern regardless of which specific algorithm is used:

  1. Collect labeled training data. For a loan approval system, this means past loan applications each labeled "repaid" or "defaulted." For a spam filter, past emails each labeled "spam" or "not spam." For a medical imaging system, past X-rays each labeled by a physician.
  2. Train the model. The learning algorithm examines the labeled examples and extracts patterns — the relationships between the input attributes and the correct output label. The result is a model.
  3. Evaluate on held-out data. Before deploying, the model is tested on examples it has never seen (held out from training) to estimate how well it will perform in the real world.
  4. Deploy and monitor. The model is applied to new, unlabeled inputs. In many systems, its predictions are monitored over time and the model is retrained periodically as new labeled data accumulates.

The Label Problem

Supervised learning is powerful when you have good labeled data. The word "good" matters: labels need to be accurate, consistent, and representative of the full range of inputs the model will encounter. Bad labels produce bad models, no matter how sophisticated the learning algorithm.

Labels also need to come from somewhere, and that somewhere is usually human effort. Labeling thousands of medical images requires physicians. Labeling thousands of social media posts for toxicity requires human reviewers. This is expensive, slow, and subject to the biases and limitations of whoever is doing the labeling. The cost of labeling is one of the primary practical constraints on supervised learning.

Some supervised learning problems have labels that arise naturally. Every email a user marks as spam is a new labeled example, generated at essentially zero cost. Every loan that is repaid or defaulted adds a labeled example to the bank's dataset. When labels can be collected automatically from normal operations, the data problem becomes much more tractable.

What Supervised Learning Produces

Supervised learning produces a classifier (when the output is a category, like spam/not spam or approve/deny) or a regressor (when the output is a numerical value, like a predicted exam score or a house price estimate). Either way, the model takes in new inputs and produces a prediction based on patterns learned from labeled examples.

Unsupervised Learning

Unsupervised learning starts from a different situation: a large collection of data with no labels attached. No one has told the system what the correct output is for any example. Instead of learning to predict a known outcome, the system looks for structure in the data itself — patterns, groupings, and relationships that are not defined in advance.

The goal is discovery rather than prediction. Unsupervised learning asks: what is in this data that we did not already know to look for?

Clustering: The Core Unsupervised Task

The most common form of unsupervised learning is clustering: grouping inputs into categories based on similarity, without any predefined category labels. The algorithm does not know how many groups there should be or what they represent — it discovers the groupings from the data.

Consider a school district that has five years of student performance data but no particular question in mind. A clustering algorithm might discover that students naturally fall into four distinct groups based on patterns in their data — attendance, grades, course selections, extracurricular activities — groups that no administrator had previously identified or named. Those groups might turn out to correspond to meaningful distinctions: students on a college preparatory track, students who are strong athletes with moderate academic engagement, students who are highly engaged in arts programs, and students who show signs of disengagement across all domains. The algorithm found the structure; the human gives it meaning.

This is the characteristic pattern of unsupervised learning: the machine discovers the categories, and the human interprets them. The machine cannot tell you what the clusters mean. It can only tell you that they exist and show you what is in each one.

Other Unsupervised Techniques

Clustering is the most intuitive unsupervised approach, but others appear regularly in real systems:

What Unsupervised Learning Cannot Do

Unsupervised learning cannot make predictions about specific labeled outcomes. If you want a system to tell you whether a particular student is at risk of failing, you need labels from past students to supervise the learning. Unsupervised learning can tell you that students cluster into groups with different patterns, but it cannot tell you which groups are at risk without connecting those groups to known outcomes.

This is not a weakness — it is the natural boundary of the approach. Unsupervised learning is the right tool when you do not know what you are looking for. Supervised learning is the right tool when you do.

Side by Side

Property Supervised Learning Unsupervised Learning
Training data Labeled (correct answers known) Unlabeled (no correct answers)
Goal Predict a known output for new inputs Discover hidden structure in data
Human role Provide labels; evaluate predictions Interpret discovered patterns
Output A classifier or regressor Clusters, compressed representations, anomaly scores
Requires knowing the question? Yes — the label defines the question No — the data defines what can be found
Examples Spam filters, loan approval, medical imaging, decision trees Customer segmentation, anomaly detection, recommendation systems

In Reading 3, we look at the third category — reinforcement learning — which is different from both of these in a fundamental way: it does not learn from a fixed dataset at all. It learns by interacting with the world.