No history yet

Introduction to Supervised Learning

Learning with an Answer Key

Imagine you're teaching a child to identify animals. You show them a picture of a cat and say, "This is a cat." Then you show them a picture of a dog and say, "This is a dog." After repeating this with many different pictures, the child starts to learn the patterns that distinguish cats from dogs. Eventually, you can show them a new picture, and they can tell you if it's a cat or a dog.

This is the core idea behind supervised learning. It's a type of machine learning where the computer learns from data that already has the correct answers. We provide the algorithm with a dataset containing inputs (like the animal pictures) and their corresponding correct outputs or "labels" (the words "cat" or "dog"). The algorithm's job is to figure out the relationship between the inputs and outputs.

Labeled Data

noun

Data that includes both the input features and the correct output, or label. This label serves as the "answer" that the model learns from during training.

This labeled data is the foundation of supervised learning. Without it, the model has no way of knowing if its predictions are right or wrong. It's the equivalent of a student's textbook having an answer key in the back. By checking its work against the correct answers, the model refines its understanding and gets better at making predictions.

Lesson image

Supervised vs. Unsupervised Learning

The main difference between supervised and unsupervised learning comes down to that answer key. Supervised learning has it; unsupervised learning does not.

In unsupervised learning, we give the model a dataset without any labels. Instead of predicting a specific outcome, the goal is to find hidden patterns or structures within the data itself. Think of giving someone a box of mixed fruits and asking them to sort it. They might group the fruits by color, size, or type without ever being told the names "apple," "banana," or "orange." They discover the categories on their own.

This makes unsupervised learning useful for tasks like customer segmentation, where a business might want to group customers based on purchasing behavior without any preconceived notions of what those groups should be.

Supervised learning predicts outcomes using labeled data. Unsupervised learning discovers patterns in unlabeled data.

The Supervised Learning Workflow

Developing a supervised learning model follows a consistent process. The goal is to create a model that not only learns from the data it's seen but can also make accurate predictions on new, unseen data.

The first step is always to gather and prepare your labeled dataset. This might involve cleaning the data to remove errors and formatting it correctly.

Next, you split this data into two parts: a training set and a testing set. The model learns the patterns from the training set. The testing set is kept separate and is used later to evaluate how well the model performs on data it has never encountered.

Lesson image

During the training phase, the algorithm goes through the training data and tries to build a mathematical function that maps the inputs to the outputs. After the model is trained, it's time for the test. We feed it the inputs from the testing set and compare the model's predictions to the actual labels. This tells us how accurate and reliable our model is.

If the performance is good, the model is ready to be used for making predictions on new, real-world data.

Now that you've got the basics, let's test your understanding.

Quiz Questions 1/5

What is the defining characteristic of the data used in supervised learning?

Quiz Questions 2/5

In the process of developing a supervised learning model, why is the data split into a training set and a testing set?

Supervised learning is a powerful tool for making predictions when you have historical data with known outcomes. By understanding its core principles, you're taking the first step toward applying it to solve real problems.