liveBook · Manning

Supervised learning

As explained in Grokking Machine Learning, Second Edition

A machine-learning approach in which a model learns from labeled examples containing inputs and corresponding target outputs.

Supervised learning teaches a model from labeled examples: each data point includes inputs and a target label. The model learns a rule from known examples, then predicts the label for unseen data. section 2.6 section 2.7

The target label determines the kind of prediction:

  • Regression predicts numerical data, such as a price, size, weight, or other number. section 2.7 section 2.17
  • Classification predicts categorical data, such as dog or cat, legitimate or fraudulent, or another finite set of classes. section 2.7 section 2.17
  • The basic process is remember the labeled dataset, formulate a rule, and predict an output for new data. section 2.7

Recognizing a new pet image

A dataset of pet images labeled “dog” or “cat” lets a model learn patterns associated with each category. When given an unlabeled image, it predicts whether the image shows a dog or a cat. A second labeled dataset might pair pet images with numerical weights, turning the task into regression. section 2.6 section 2.7

Figure 2.1 Labeled data is data that comes with a tag, or label. That label can be a type or a number. Unlabeled data is data that comes with no tag. The dataset on the left is labeled, and the label is the type of pet (dog/cat). The dataset in the middle is also labeled, and the label is the weight of the pet (in pounds). The dataset on the right is unlabeled.

Compare labeled pet data carrying a category or number with unlabeled pet images carrying no target feature. section 2.6

Practice identifying the learning setup in everyday applications:

  • Classify recommendation systems, topic grouping, autocomplete, and fraud detection as supervised or unsupervised learning. section 2.18
  • Choose regression or classification for spending prediction, voice decoding, stock decisions, and video recommendations. section 2.18

How Grokking Machine Learning, Second Edition covers it

How deep it goes
Defines labels, explains the prediction workflow, and distinguishes regression from classification without developing specific algorithms.
Examples
Uses pet-image labeling, housing prices, stock prices, spam detection, fraud detection, recommendations, and voice decoding.
What it assumes
Explains labeled and unlabeled data directly while assuming no prior machine-learning knowledge.
What you can do after
Evaluate whether a problem is supervised, then select regression or classification for its target.
How it connects
Contrasts with unsupervised learning and reinforcement learning, and connects to regression, classification, numerical data, and categorical data.

Also explained in

Compare how 24 books explain supervised learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning, Second Edition. The section links point to the parts of the book it draws on.