Sitemap

Machine Learning Concepts Explained #2: The Four Types of Machine Learning

8 min readJul 2, 2026

--

Not all machine learning models learn in the same way. Some learn from correct answers, others discover hidden patterns on their own, and some improve through trial and error. In this article, we’ll explore the four major types of machine learning and when to use each one.

Press enter or click to view image in full size

Introduction

In the previous article, we learned that machine learning allows computers to discover patterns from data instead of relying on explicitly programmed rules.

But this raises an important question.

How exactly does a machine learn from data?

The answer depends on the information we provide.

Sometimes we already know the correct answers.
Sometimes we only have raw data.
Sometimes we have a mix of both.
And sometimes the machine has to learn entirely through trial and error.

These different learning strategies form the four major categories of machine learning.

Before exploring each one, let’s look at the big picture.

The Big Picture

Press enter or click to view image in full size
Machine Learning Categories

Each approach answers a different question.

Press enter or click to view image in full size
Types of Machine Learning

Let’s explore them one by one.

1. Supervised Learning

Definition

Supervised learning is the most common type of machine learning.

The model learns from labeled data, where every training example already includes the correct answer.

Think of it as learning with a teacher.

The teacher already knows the answers and provides feedback whenever the student makes a mistake.

Example

Imagine you’re predicting house prices.

| Size | Bedrooms |    Price |
| ---- | -------- | -------- |
| 90 | 2 | $450,000 |
| 140 | 4 | $720,000 |
| 180 | 5 | $910,000 |

Notice something important.

Every house has a known selling price.

Those prices are the labels.

The model studies these examples and learns how different features influence the final price.

Diagram

Press enter or click to view image in full size
Supervised Learning Diagram

During the training phase, the machine learning algorithm learns patterns from the training data and their corresponding training labels, producing a learned model.

During the prediction phase (also called the inference phase), the learned model receives new data and uses the patterns it learned during training to make predictions.

Everyday Examples

  • Spam detection
  • House price prediction
  • Disease diagnosis
  • Credit approval
  • Customer churn prediction

Industries

  • Banking
  • Healthcare
  • Insurance
  • Retail
  • Real Estate

Subcategories of Supervised Learning

Supervised learning is a broad category that can be divided into two main types based on the kind of prediction the model makes.

Press enter or click to view image in full size
Supervised Learning Subcategories

1. Regression

Regression is used when the target variable is continuous, meaning it can take any numerical value within a range.

The goal is to predict a number.

Examples:

  • Predicting house prices
  • Forecasting tomorrow’s temperature
  • Estimating a person’s salary
  • Predicting stock prices
  • Estimating electricity consumption

Example Output:

House Price = $645,000
Temperature = 24.7°C
Salary = $82,500

2. Classification

Classification is used when the target variable belongs to one of several predefined categories.

Instead of predicting a number, the model predicts a class.

Examples:

  • Spam or Not Spam
  • Fraud or Not Fraud
  • Benign or Malignant Tumor
  • Customer Will Churn or Will Not Churn
  • Cat, Dog, or Rabbit

Example Output:

Spam
Fraud
Cat

2. Unsupervised Learning

Definition

What if we don’t have the correct answers?

Suppose we only have data.

Can the computer still learn something useful?

Yes.

Instead of predicting answers, it searches for hidden patterns.

Example

Imagine an online store with thousands of customers.

The company knows:

  • Age
  • Income
  • Products purchased

But it doesn’t know which customers belong to the same group.

The algorithm automatically discovers groups such as:

Students
Professionals
Families
Luxury Shoppers

Nobody labeled these groups.

The computer discovered them.

Diagram

Press enter or click to view image in full size

During the training phase, the machine learning algorithm analyzes the training data to discover hidden patterns and relationships. Unlike supervised learning, no training labels are provided. The result of this process is a learned model.

During the prediction phase, the learned model analyzes new data and identifies patterns, similarities, or groups based on what it learned during training. For example, it may group similar customers into clusters without being told what those groups should be.

Everyday Examples

  • Customer segmentation
  • Document clustering
  • Grouping songs by similarity
  • Organizing news articles
  • Market basket analysis

Industries

  • Marketing
  • Retail
  • Healthcare Research
  • Social Media
  • E-commerce

Subcategories of Unsupervised Learning

Unsupervised learning includes several techniques for discovering hidden patterns in data. The most common subcategories are clustering, dimensionality reduction, association rule learning, and anomaly detection.

Press enter or click to view image in full size
Unsupervised Learning Subcategories

1. Clustering

Clustering groups similar data points together without using predefined labels.

The algorithm identifies natural groupings based on similarities in the data.

Examples:

  • Customer segmentation
  • Grouping similar news articles
  • Organizing photos by similar faces
  • Music recommendation

Example Output

Cluster 1 → Students
Cluster 2 → Families
Cluster 3 → Professionals

Popular Algorithms

  • K-Means
  • Hierarchical Clustering
  • DBSCAN

2. Dimensionality Reduction

Sometimes datasets contain hundreds or even thousands of features.

Dimensionality reduction simplifies the data by reducing the number of features while preserving as much important information as possible.

Get Basak Kaya’s stories in your inbox

Join Medium for free to get updates from this writer.

This makes models faster, easier to visualize, and often more effective.

Examples:

  • Visualizing high-dimensional data
  • Compressing datasets
  • Removing redundant features

Popular Algorithms

  • PCA (Principal Component Analysis)
  • t-SNE
  • UMAP

3. Association Rule Learning

Association rule learning discovers relationships between items that frequently occur together.

It answers questions such as:

“If a customer buys X, what else are they likely to buy?”

Examples:

  • Market basket analysis
  • Product recommendations
  • Cross-selling

Example:

Bread + Butter
↓
Milk

This means customers who buy bread and butter often also buy milk.

Popular Algorithms

  • Apriori
  • FP-Growth
  • Eclat

4. Anomaly Detection

Anomaly detection identifies observations that are significantly different from the rest of the data.

Rather than forming groups, the algorithm looks for unusual or unexpected behavior.

Examples:

  • Credit card fraud detection
  • Network intrusion detection
  • Equipment failure detection
  • Manufacturing quality control

Example Output

Normal Transaction ✅
Normal Transaction ✅
Unusual Transaction ⚠️

Popular Algorithms

  • Isolation Forest
  • One-Class SVM
  • Local Outlier Factor (LOF)

3. Semi-Supervised Learning

Definition

Labeling data is expensive.

Imagine collecting one million images. Labeling every image by hand could take months.

Instead, suppose only 5,000 images have labels. Can we still use the remaining 995,000 images?

Yes.

That’s exactly what semi-supervised learning does.

Diagram

Press enter or click to view image in full size
Semi-Supervised Learning Diagram

During the training phase, the machine learning algorithm learns from both labeled and unlabeled data. The labeled data provides the correct answers, while the unlabeled data helps the model discover additional patterns and relationships. Together, they are used to create a learned model.

During the prediction phase, the learned model receives new data and uses what it learned during training to make predictions.

Example

A hospital has:

  • 2,000 X-rays labeled by radiologists
  • 300,000 unlabeled X-rays

Instead of ignoring the unlabeled images, the model learns from both datasets.

This often produces better results than using only the labeled examples.

Industries

  • Healthcare
  • Computer Vision
  • Speech Recognition
  • Natural Language Processing

Common Approaches to Semi-Supervised Learning

Semi-supervised learning includes several techniques, such as self-training, label propagation, and pseudo-labeling.

4. Reinforcement Learning

Definition

Reinforcement learning works differently from the other three.

Instead of learning from examples, the model learns by interacting with an environment.

Every action receives either reward or penalty.

The objective is to maximize long-term rewards.

Example

Imagine teaching a dog a new trick.

Correct action 
↓
Treat


Wrong action
↓
No treat

Eventually, the dog learns which actions lead to rewards.

Reinforcement learning follows the same idea.

Diagram

Press enter or click to view image in full size
Reinforcement Learning Diagram

In reinforcement learning, an agent interacts with an environment by taking actions. After each action, the environment responds with a new state and a reward (or penalty), indicating how good the action was. Over time, the agent learns which actions maximize its total reward.

Everyday Examples

  • Chess AI
  • Self-driving cars
  • Robotics
  • Video game AI
  • Robot navigation

Industries

  • Robotics
  • Gaming
  • Logistics
  • Autonomous Vehicles
  • Manufacturing

Comparing the Four Types

Press enter or click to view image in full size
Comparison Table

Which One Should You Use?

A useful way to choose is to ask yourself one question:

Do I already know the correct answers?

  • Yes → Use Supervised Learning.
  • No, but I want to discover patterns → Use Unsupervised Learning.
  • ️I have only a small amount of labeled data → Use Semi-Supervised Learning.
  • The model needs to make a sequence of decisions and improve through feedback → Use Reinforcement Learning.

This simple decision process can help you classify many machine learning problems before you even think about specific algorithms.

Summary Diagram

Press enter or click to view image in full size
ML Categories Summary Diagram

Key Takeaways

  • Machine learning is not a single technique but a collection of different learning approaches.
  • Supervised learning uses labeled data to predict known outcomes.
  • Unsupervised learning discovers hidden patterns without labels.
  • Semi-supervised learning combines a small amount of labeled data with a large amount of unlabeled data.
  • Reinforcement learning learns through rewards and penalties by interacting with an environment.
  • Choosing the right type of machine learning depends on the data you have and the problem you’re trying to solve.

What’s Next?

Now that you understand the four major types of machine learning, it’s time to look at the end-to-end machine learning workflow.

In the next article, we’ll follow a real-world project from start to finish, covering:

  • Defining the problem
  • Collecting data
  • Cleaning the data
  • Feature engineering
  • Training a model
  • Evaluating performance
  • Deploying the model
  • Monitoring it in production

By the end of that article, you’ll understand the complete lifecycle of a machine learning project before diving into individual algorithms.

Keep in Touch

Thanks for reading! This blog is where I explore data science, machine learning, AI, optimization, simulation, decision-making, and interesting mathematical ideas — sharing projects, experiments, and thoughts I discover along the way.

--

--

Basak Kaya
Basak Kaya

Written by Basak Kaya

I am an MEng student at University of Toronto focused on data analytics and machine learning. I write about Python, SQL, data science, deep learning, and cloud.