Course contentsShow
← Computer Science
Lesson 2786 of 2,87262. Machine Learning FundamentalsFree lesson

Supervised Learning: Learning from Labeled Examples

Understanding supervised learning as learning a function from input-output pairs with known correct labels.

Supervised Learning: Learning from Labeled Examples

What You'll Learn

You'll understand how supervised learning trains models by learning patterns from examples where the correct answers are already known.

The Core Idea

Supervised learning is the process of teaching a machine to map inputs to outputs by showing it many examples of correct input-output pairs. Think of it like teaching a child to identify fruits: you show them an apple and say "this is an apple," show them a banana and say "this is a banana," and after enough examples, they learn to recognize these fruits on their own.

In supervised learning, each training example consists of:

  • Input features (the data you observe)
  • A label (the correct answer or target output)

The algorithm's job is to learn a function that takes features as input and predicts labels as accurately as possible. During training, the model sees both the features and the correct labels, allowing it to adjust itself by comparing its predictions against the truth.

Why "Supervised"?

The term "supervised" comes from the fact that learning happens under supervision—we provide the correct answers during training. The model isn't exploring blindly; it has a teacher (the labeled data) guiding it toward better predictions.

This contrasts with learning from unlabeled data, where no correct answers are provided upfront.

Examples in Context

  • Classification: Given features of an email (words, sender, etc.), predict the label "spam" or "not spam"
  • Regression: Given features of a house (size, location, age), predict its price (a numerical label)

The training data contains both the features and the known labels, allowing the model to learn the underlying patterns.

Key Takeaway: Supervised learning uses labeled training examples (input-output pairs) to learn a function that maps new, unseen inputs to predicted outputs, guided by known correct answers during training.