Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 48

Types of Machine Learning

Recommended resources

Introduction

Welcome to your second lesson in the "Foundations of Machine Learning" module. In our previous session, we established the fundamental difference between traditional programming and machine learning. You learned that while traditional programming is about feeding a computer explicit rules to get answers, machine learning is about feeding it data and answers to make it infer the rules on its own.

Today, we will build directly on that foundation. If machine learning is about learning from data, the next logical question is: what are the different ways a machine can learn? This lesson addresses the learning outcome: to distinguish between supervised, unsupervised, and reinforcement learning.

These three paradigms are the primary strategies in the AI playbook. For someone aspiring to build transformative technology, mastering these concepts is like a grandmaster learning the fundamental theories of chess openings, middlegames, and endgames. Each is designed for a different type of problem and a different strategic objective. Understanding when and why to use each one is a cornerstone of thinking like an AI architect.


1. The Three Learning Paradigms: An Intuitive Overview

Before we dive into formal definitions, let's build some intuition using an analogy. Imagine teaching a young child about different animals.

  • Supervised Learning: You take the child to a farm, point to a goat, and say, "This is a goat." You point to a chicken and say, "This is a chicken." You provide explicit examples with correct labels. The child learns under your direct supervision.
  • Unsupervised Learning: You let the child wander around the farm. You don't name any animals. The child observes on their own and starts to notice patterns: "That group of animals has four legs and fur, while this other group has two legs and feathers." The child creates categories without being given the names for them.
  • Reinforcement Learning: You put the child in a maze with a piece of chocolate at the end. You don't give them a map. When they make a correct turn, a green light flashes (a reward). When they hit a dead end, a red light flashes (a penalty). Through trial and error, the child learns the path to the chocolate to maximize their rewards.

This simple analogy captures the essence of the three main approaches to machine learning.

Three Types of Machine Learning
This image provides a visual summary. Unsupervised learning finds hidden groups (clustering). Supervised learning learns a boundary to separate pre-labeled groups (classification). Reinforcement learning finds an optimal path through a series of actions and rewards.

2. Supervised Learning: Learning with a Teacher

Supervised learning is the most common and straightforward paradigm. The "supervision" comes from the data itself, which has been pre-labeled with the correct answers by a human. The algorithm's job is to learn the mapping function that connects the input data to the output labels.

  • Core Idea: Learning from labeled examples.
  • Data Requirement: A dataset where each example consists of input features and a corresponding correct output label (or target).
  • Goal: To train a model that can accurately predict the label for new, unseen data.

Think back to the spam filter from our last lesson. The task was to classify emails. The "experience" was a large dataset of emails already labeled as "spam" or "not spam." This is a classic example of supervised learning.

There are two main types of supervised learning tasks:

  1. Classification: The output label is a discrete category.
    • Examples: Is this email spam or not spam? Does this tumor image show a malignant or benign cell? Is this a picture of a cat, a dog, or a bird?
  2. Regression: The output label is a continuous, numerical value.
    • Examples: What will be the price of this house based on its size and location? How many sales will we make next quarter? What will the temperature be tomorrow?

To get a more formal understanding, please read the following section from the Wolfram documentation on Machine Learning.

Machine Learning Paradigms - Wolfram

This reading defines supervised learning, explains the concept of input-output pairs (labeled examples), and distinguishes between regression and classification tasks.

Please read the section titled 'Supervised Learning'. Focus on the definition of 'labeled examples', 'features', and 'labels'. Note the examples provided for both regression and classification.


3. Unsupervised Learning: Finding Structure on Your Own

In unsupervised learning, we work with data that has no predefined labels. The algorithm is given a dataset and must find meaningful structure or patterns within it on its own. There is no "teacher" or "answer key."

  • Core Idea: Discovering hidden patterns in unlabeled data.
  • Data Requirement: A dataset consisting of input features only, with no corresponding output labels.
  • Goal: To explore the data and draw inferences from it, such as grouping similar items together.

There are two primary types of unsupervised learning tasks:

  1. Clustering: The goal is to group data points into clusters, where items in the same cluster are more similar to each other than to those in other clusters.
    • Examples: Grouping customers into different market segments based on their purchasing behavior. Grouping news articles by topic.
  2. Dimensionality Reduction: The goal is to reduce the number of variables (features) in a dataset while preserving its important structure. This is often used to simplify data for visualization or to improve the performance of other machine learning algorithms.
    • Examples: Summarizing a customer's multiple features (age, income, spending habits) into a single "customer profile" score.

Let's continue with the Wolfram resource to formalize this concept.

Machine Learning Paradigms - Wolfram

This next section explains unsupervised learning, contrasting it with the supervised approach. It introduces key tasks like clustering and dimensionality reduction.

Read the section titled 'Unsupervised Learning'. Pay attention to how it's defined by the absence of labels and focus on understanding the goals of clustering and dimensionality reduction.


4. Reinforcement Learning: Learning from Consequences

Reinforcement Learning (RL) is a paradigm of learning through interaction. It is fundamentally different from the other two because there is no static dataset. Instead, an agent learns by performing actions within an environment to achieve a goal.

  • Core Idea: An agent learns a strategy (a policy) by performing actions and receiving rewards or penalties.
  • Data Requirement: No initial dataset is needed. The agent generates its own data through experience.
  • Goal: To learn the optimal policy that maximizes the total cumulative reward over time.

This trial-and-error process is how we see AI mastering complex games like Go (AlphaGo) or controlling robotic systems. The agent isn't told what the right move is in any situation (like in supervised learning), but it learns the consequences of its actions.

The following reading will clarify the key components of this paradigm.

Machine Learning Paradigms - Wolfram

Finally, let's explore reinforcement learning. This section explains how an agent learns by interacting with an environment through a system of actions and rewards.

Read the section titled 'Reinforcement Learning'. Focus on defining the key terms: agent, environment, action, observation, and reward. Note the examples given, such as a robot learning to walk.


5. Comparing the Three Paradigms

Now that you've been introduced to each paradigm, let's bring them all together. The key is to understand how they differ in terms of their goals, the data they use, and the feedback they receive.

Comparison of Supervised, Unsupervised, and Reinforcement Learning
This flowchart clearly shows the different inputs and processes for each learning type. Supervised learning maps labeled data to a target. Unsupervised learning finds classes in unlabeled data. Reinforcement learning uses states, actions, and rewards to produce a new action.

Here is a summary table to consolidate the distinctions:

Feature Supervised Learning Unsupervised Learning Reinforcement Learning
Data Type Labeled Data (features + correct labels) Unlabeled Data (features only) No predefined dataset; agent generates data via interaction.
Goal Predict an output/label for new data. Discover hidden structure or patterns in data. Learn a series of actions (a policy) to maximize reward.
Feedback Mechanism Direct feedback: The model's prediction is compared to the correct label. No direct feedback; evaluation is based on discovered structures. Indirect feedback: The agent receives a reward or penalty from the environment.
Analogy A student learning with a teacher and an answer key. A detective grouping clues to find patterns. A puppy learning tricks through treats and praise.
Example Question "Based on this data, is this a cat or a dog?" "What natural groupings exist in this data?" "What should I do next to get closer to my goal?"
Common Tasks Classification, Regression Clustering, Dimensionality Reduction, Association Game playing, Robotics, Navigation, Resource management

To see these concepts explained with more examples and from a different perspective, the following video provides a comprehensive comparison.

Supervised vs Unsupervised vs Reinforcement Learning | Data Science Certification Training | Edureka

This video from Edureka offers a detailed side-by-side comparison of the three learning paradigms, covering their definitions, types of problems, training methods, and applications.

Watch from the explanation of supervised learning (02:20) through the discussion of applications (ending around 15:23). As you watch, try to map the speaker's points back to the summary table above. Pay special attention to the examples they provide for each type of learning.


Conclusion

In this lesson, you have unpacked the three fundamental strategies of machine learning. Understanding these paradigms is the first step toward architecting intelligent systems.

Key Takeaways:

  • Supervised Learning learns from labeled data to make predictions. It's about learning a mapping from a known input to a known output. It's a predictive task.
  • Unsupervised Learning learns from unlabeled data to find hidden structures. It's about discovering patterns. It's a descriptive task.
  • Reinforcement Learning learns from interacting with an environment through trial and error. It's about learning a strategy to maximize a reward. It's a prescriptive task.
  • The choice of paradigm is determined by the problem you want to solve and the type of data you have available.

Preview of the Next Lesson:
We've now discussed what ML is and the primary ways it works. In the next lesson, we will formalize some of the terminology we've introduced today. You will learn to explain the concepts of features, labels, training data, and models. These are the essential building blocks you'll work with when you start implementing these ideas in code.