Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Types of Machine Learning

Introduction

In our last lesson, we explored the mechanics of forward propagation, clarifying how a neural network processes inputs layer by layer to generate a prediction. We saw that this process is determined by the network's parameters—its weights and biases. This naturally leads to the next critical question: how does the network find the right parameter values to make accurate predictions? How does it "learn"?

This lesson addresses that question by introducing the three fundamental paradigms of machine learning. The way a model learns is dictated by the nature of the problem it's trying to solve and, most importantly, the type of data available. Your goal for this lesson is to distinguish between supervised, unsupervised, and reinforcement learning, and to be able to identify which approach is suitable for a given problem. Understanding these categories is the first step toward understanding the model training process itself.

A Visual Map of Machine Learning Paradigms

At the highest level, the three paradigms can be thought of as learning with an answer key, learning by finding patterns, and learning through trial and error.

A visual summary of the three main types of machine learning. Unsupervised learning finds clusters in unlabeled data. Supervised learning uses labeled data to find a decision boundary. Reinforcement learning learns through a cycle of actions and rewards in an environment.

Let's break down each of these approaches.

1. Supervised Learning: Learning with a Teacher

Supervised learning is the most common and straightforward paradigm. The name "supervised" is apt because the learning process is guided by a dataset that contains the "correct answers." The model is provided with a large set of labeled examples, where each example consists of an input and its corresponding desired output. The model's task is to learn the mapping function that turns the input into the output.

As a developer, you can think of this as being given a vast set of (input, output) pairs and being asked to write the function that produces the correct output for any given input. The machine learning model's job is to automatically deduce the logic of that function from the examples.

The following article provides an excellent breakdown of this concept.

Types of Machine Learning: Supervised, Unsupervised ...

This section from DigitalOcean's guide clearly defines supervised learning, explains the critical role of labeled data, and introduces its two main sub-categories.

Please read the section titled "1. Supervised learning". As you read, focus on: The definition: learning from labeled training data. The core example: a spam detection system learning from emails labeled "spam" or "not spam". The two primary tasks: classification (predicting a category, like spam/not spam) and regression (predicting a continuous value, like a house price).

Key Examples:

  • Image Classification: Given thousands of images of cats and dogs, each labeled "cat" or "dog," the model learns to classify new, unlabeled images.
  • Fraud Detection: Given historical transaction data labeled as "fraudulent" or "legitimate," the model learns to identify fraudulent activity in real-time. This is a classification task.
  • Stock Price Prediction: Given historical stock prices over time, the model learns to predict the price for the next day. This is a regression task.

2. Unsupervised Learning: Learning without an Answer Key

What if you don't have labeled data? This is where unsupervised learning comes in. In this paradigm, the model is given a dataset without any explicit output labels and must find inherent structures or patterns on its own. It's like a detective sifting through evidence to find connections and group related items without being told what to look for.

For a developer, this is analogous to being given a massive, unorganized database of user activity and being asked to "find interesting groups of users" or "identify unusual behavior." The goal isn't to predict a specific, known value but to discover the underlying structure of the data itself.

Types of Machine Learning: Supervised, Unsupervised ...

This section builds on the previous one by contrasting the "guided" approach of supervised learning with the exploratory nature of unsupervised learning.

Now, please read the section "2. Unsupervised learning" from the same article. Pay attention to: The definition: discovering hidden patterns without labeled examples. The core example: a streaming service analyzing viewing habits to find natural groupings of users. The main techniques: clustering (grouping similar data points) and dimensionality reduction (simplifying data by removing redundancy).

Key Examples:

  • Customer Segmentation: A retail company uses clustering to group customers into segments (e.g., "budget shoppers," "brand loyalists") based on their purchasing history.
  • Topic Modeling: Analyzing a large collection of news articles to automatically group them by topic (e.g., "sports," "politics," "technology").
  • Anomaly Detection: Identifying unusual patterns in network traffic that could indicate a security threat or system failure.

3. Reinforcement Learning: Learning from Experience

Reinforcement learning (RL) is a completely different approach. It's not about learning from a static dataset at all. Instead, it's about an agent learning to make decisions by performing actions in an environment to achieve a goal. The agent learns through trial and error, receiving rewards for good actions and penalties for bad ones. Its sole objective is to learn a strategy, or policy, that maximizes its cumulative reward over time.

This is the most human-like way of learning. Think about how a child learns to walk—by trying, falling (penalty), and eventually succeeding (reward). Or how you might learn to play a video game—by exploring, making mistakes, and discovering which actions lead to a higher score.

Types of Machine Learning: Supervised, Unsupervised ...

This final section introduces the dynamic, interactive nature of reinforcement learning.

Please read the section titled "3. Reinforcement learning". Focus on these key components: The definition: an agent learns by interacting with an environment. The feedback mechanism: receiving rewards or penalties for its actions. The goal: to maximize long-term rewards through experimentation and optimization. The core example: a self-driving car learning to navigate by being rewarded for safe driving and penalized for mistakes.

Key Examples:

  • Game Playing: An AI agent like AlphaGo learns to master the game of Go by playing millions of games against itself and optimizing its strategy based on wins (rewards) and losses (penalties).
  • Robotics: A robotic arm learns to pick up objects by trying different movements and receiving rewards for successful grasps.
  • Resource Management: An AI system learns to optimize the cooling of a data center by adjusting controls and getting rewarded for reducing energy consumption while maintaining safe temperatures.

A Systematic Comparison

To solidify your understanding, it's helpful to compare these three paradigms across several key dimensions: the data they use, their training process, their ultimate goal, and their feedback mechanism. The following video provides a clear, structured breakdown.

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

This video from edureka! offers a fantastic side-by-side comparison of the three learning paradigms, which will help you structure your mental model of their differences.

Please watch the following segments, which break down the comparison into distinct categories: Types of Problems Solved: This section contrasts the classification/regression tasks of supervised learning with the clustering/association tasks of unsupervised learning and the action-based problems of reinforcement learning. Data and Training: Here, the video explains the difference between labeled data, unlabeled data, and the dynamic, agent-generated data in RL. Aim, Approach, and Feedback: This is a crucial segment that summarizes the core goal (prediction vs. discovery vs. maximizing rewards) and the feedback loop (direct feedback, no feedback, or reward-based feedback) for each type.

For a quick reference you can also review the detailed comparison table in the DigitalOcean article under the section "Core types of machine learning". This table is an excellent summary of the trade-offs, use cases, and limitations of each approach.

Conclusion

In this lesson, you've learned to distinguish between the three primary paradigms of machine learning. This framework is essential for understanding how different AI systems are built and for which tasks they are suited.

Here are the key takeaways:

  • Supervised Learning: Learns from labeled data to make predictions. It's like having a teacher with an answer key. It solves classification and regression problems.
  • Unsupervised Learning: Learns from unlabeled data to find hidden patterns or structures. It's like being a detective looking for clues. It handles clustering and dimensionality reduction.
  • Reinforcement Learning: An agent learns through trial and error in an environment, guided by rewards and penalties. It's about learning an optimal strategy to achieve a goal.

With this foundational knowledge, we are now ready to dive deeper into the "how." In our next lesson, we will focus on supervised learning and explore the end-to-end training process. You will learn how a model uses labeled data, a loss function, and an optimization algorithm like gradient descent to adjust its weights and biases and truly learn from data.

Can't find a good explanation? Sign up and we'll make it for you

Sign up