Skip to main content

Section 5.2 Supervised Learning

Supervised learning is a type of machine learning in which the learning system is provided with example inputs that are paired with their desired outputs. In this setup, the algorithm is given training data and explicitly told which specific labels or target values should be associated with each input.
The process of supervised learning can be broken into several steps. First, the algorithm receives a set of training examples. Each example consists of an input and its correct output. Second, the algorithm makes a prediction based on the input. Third, the algorithm compares its prediction to the correct output and calculates the difference—this is the error. Fourth, the algorithm adjusts its internal parameters to reduce this error. Fifth, the algorithm repeats this process many times, gradually improving its predictions.
This process is often called training. During training, the model learns the relationship between inputs and outputs by adjusting its parameters to minimize error. Once training is complete, the model can be used to make predictions on new, unseen data.
By comparing its predicted output with the true output, the algorithm measures its error, learns from its mistakes, and modifies the underlying model accordingly. The primary goal of supervised learning is to learn underlying patterns from labeled data so that the model can accurately predict the labels or values of new, previously unseen data.
Labeled data means that each example in the training set has been annotated with the correct answer. For example, if we want to train a model to recognize handwritten digits, we would need thousands of images of handwritten digits, each labeled with the digit it represents (0, 1, 2, and so on).
Creating labeled data is often expensive and time-consuming because it typically requires human expertise. For this reason, labeled data is sometimes called "ground truth." It is the standard against which the model’s predictions are measured.
Because the correct target is required for every training example, supervised learning relies heavily on labeled data, which is often annotated by human experts or domain specialist systems.

Look Closer.

Why is it called "supervised" learning? Think of the algorithm as a student studying with flashcards. The front of the card has the input (such as an image or a set of measurements), and the back has the correct answer (the label). The "supervisor" or teacher provides the correct answers during training so the student can check its work, adjust its understanding, and prepare to take a test on brand-new questions it has never seen before.

Subsection 5.2.1 Categories of Supervised Learning

Supervised learning problems are generally divided into two main categories based on the type of output being predicted:
Classification
Classification algorithms predict a label or category from a finite set of discrete values. Classification problems may be binary classification, where there are only two possible classes (such as "spam" or "not spam"), or multi-class classification, featuring three or more possible categories. During training, the model learns from paired inputs and labels—for instance, an algorithm might learn from images of sharks labeled as "fish" alongside images of oceans labeled as "water." After training, the model should correctly categorize new, unlabeled images.
Regression
Regression algorithms are structured similarly to classification models, except that they predict continuous numerical values rather than discrete categories. Like classification, regression algorithms learn from pairs of input data and corresponding target values. Regression is commonly applied when the goal is to predict measurements, prices, temperatures, or other continuous quantities.
To understand the difference between classification and regression, consider some examples. If a doctor wants to predict whether a patient has a specific disease (yes or no), this is a classification problem. If a real estate agent wants to predict the price of a house based on its size and location, this is a regression problem.
The key distinction is the type of output: classification predicts discrete categories, while regression predicts continuous numbers. Both types of problems are common in practice, and choosing the right approach depends on what you want to predict.

Subsection 5.2.2 Applications of Supervised Learning

Supervised learning is widely used across technology to predict statistically likely future events from historical data. Common applications include:
  • Analyzing historical stock market information to anticipate future value fluctuations.
  • Evaluating email features to automatically identify and filter spam from an inbox.
  • Classifying unlabeled photos or diagnostic medical scans after training on curated, labeled sets of images.
Supervised learning powers many technologies we use daily. Email spam filters use classification to decide whether an incoming message is spam or legitimate. Speech recognition systems, like those in smartphones and smart speakers, use supervised learning to convert spoken words into text. Weather prediction models use regression to forecast temperature and precipitation. Credit scoring systems use classification to determine whether a loan applicant is likely to repay a loan.
These applications all share the same pattern: they learn from labeled examples and then apply that learning to new, unseen situations.

Reading Questions 5.2.3 Reading Questions

1.

You have attempted of activities on this page.