Supervised Learning — Learning with a Teacher

Supervised Learning: the ML paradigm where someone diligently labeled things beforehand.

Fundamentals 8 min Beginner May 18, 2026

When you study with flashcards, you already know the answer on the back before you flip — that is the core principle of supervised learning. The machine sees thousands of such flashcards (data with correct answers) and learns to predict the answer for cards it has never seen before.

In the previous article you learned that ML models learn from data instead of following explicit rules. Now we look at the most common form of that learning: supervised learning, where every training example comes with a correct answer attached.

Features & Labels — The Raw Material

Feature & Label

AnalogyDefinition
Think of flashcards: the front shows a picture (features), the back shows the correct name (label). You study hundreds of cards until you recognize patterns. The model learns from many examples with known answers in exactly the same way.

The flashcard analogy has a productive side-effect: you might think the model eventually memorizes the cards. That is actually a real problem — it is called overfitting, and we will come back to it shortly.

Concrete example: A spam filter is trained on 10,000 emails. Features are word frequencies, sender domain, and link count. Labels: "spam" or "not spam" (assigned by humans). The model sees 8,000 labeled emails during training and must correctly classify the remaining 2,000 it has never seen.

Labels are not always correct. Human annotators sometimes disagree, make mistakes, or apply inconsistent criteria. For a spam filter, one annotator might mark a newsletter as spam while another does not.

A model trained on noisy labels learns the teacher's errors as if they were correct patterns. The quality of labels determines the ceiling of model performance just as much as their quantity.

Interactive: Feature-Label Mapping

In the spam filter example above, you saw how features and labels work together. Here you can try for yourself how three email features affect the prediction.

Feature-Label Mapping

Three features of an email determine whether it is classified as spam. Move the sliders and observe how the prediction changes.

3
2
Calculation:3×2 + 2×3 − 0 = 12
Prediction
Spam
Score 12 > 7 (Threshold)

Classification vs. Regression — Two Flavors of Prediction

Depending on the type of label, supervised learning tasks fall into two fundamental categories. The distinction is determined entirely by the nature of the label — not by the features.

Classification

Predicts discrete categories — like a sorting machine that asks: "Which bin does this belong to?" Examples: spam/not-spam, cat/dog/bird, benign/malignant.

Regression

Predicts continuous numerical values — like a scale that asks: "How much does this weigh?" Examples: house price in euros, temperature in degrees, stock price.

Spam Filter Classification
Diagnosis Classification
House Price Regression
Weather Regression
Image Recognition Classification
Stock Price Regression

Same dataset, different questions: With patient data, the question "Is the tumor benign or malignant?" becomes classification (label is 0 or 1). The question "How large will the tumor be in six months (in mm)?" becomes regression (label is a continuous measurement). Same features, different label type, completely different ML approach.

Gray area: A product rating (1–5 stars) can be treated as regression ("predict 4.2 stars") or as 5-class classification. The choice depends on whether the distance between 3 and 4 stars matters as a metric.

Interactive: Supervised vs. Unsupervised vs. Semi-Supervised

Supervised learning is just one of three major learning paradigms. The Venn diagram shows how they overlap and what hybrid forms exist.

Click on a region to see the differences between learning paradigms.
Supervised onlyUnsupervised onlySemi-Supervised onlySupervised ∩ UnsupervisedSupervised ∩ Semi-SupervisedUnsupervised ∩ Semi-SupervisedAll threeSupervisedLearningUnsupervisedLearningSemi-Supervised

Click on a region

Click on one of the circles or intersections to find out which learning paradigm belongs there and what it means.

The Supervised Learning Workflow

Supervised learning follows a fixed five-step pipeline. The most important safeguard: the train-test split.

1
Collect & label data
2
Split: ~80% training, ~20% test
3
Choose & train a model
4
Evaluate on test data
5
Deploy model (inference — applying the model to real, new data)

Think of exam preparation: you practice with exercises (training set), but the real exam (test set) contains problems you have never seen. If you only memorized the practice answers without understanding the underlying principles, you fail the exam. That is overfitting.

Don't worry, you don't need to be able to code — this just shows how short the workflow is in practice. In Python with scikit-learn:

from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_diabetes

X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
model = LinearRegression().fit(X_train, y_train)
print(f"Test Score: {model.score(X_test, y_test):.2f}")

Line 5 loads data with features (X) and labels (y). Line 6 splits 80/20. Line 7 trains a linear regression model. Line 8 evaluates it on the unseen test data.

Common Misconceptions

  • "Labels are always correct." — In reality, label noise is a real problem. Annotators make mistakes, and the model learns these mistakes as patterns.
  • "More data always helps." — More bad labels make the model worse. Quality beats quantity.
  • "The boundary between classification and regression is always clear." — Star ratings (1–5) can be treated as either.

Transfer learning allows you to take a model pre-trained on millions of examples and fine-tune it on just a few hundred labeled data points for a new task. The pre-trained model has already learned general patterns (e.g., edges and textures for images), so only the final decision layer needs to be retrained.

Practical example: A company has only 200 labeled images for product recognition. With a model pre-trained on ImageNet (millions of images), these 200 examples are sufficient to train a working classifier.

Key Takeaways

  1. Supervised learning needs labeled data — features (input) paired with labels (correct output). Without labels, the model has no teacher.
  2. Classification predicts categories (spam/not-spam), regression predicts numbers (house price in euros). The same data can serve both depending on the question asked.
  3. The train-test split is the single most important safeguard: a model that only performs well on data it has already seen (overfitting) is useless in the real world.

Quiz: Supervised Learning

Question 1 / 6
Not completed

What is a "label" in a supervised learning dataset?

Select one answer
Answer Key: 1) B · 2) B · 3) C · 4) B · 5) B · 6) B

Comprehension Check

  • Why does a supervised learning model absolutely need labels?
  • How do you determine whether a problem should be solved with classification or regression?
  • Why is the train-test split so important — and what happens if you skip it?