AWS Builder Center

Machine Learning from Scratch – Day 2: Understanding the Types of Machine Learning

Understanding the Types of Machine Learning

Series: Machine Learning From Scratch (18 articles)

  1. 2
    Machine Learning from Scratch – Day 2: Understanding the Types of Machine Learning This article

Introduction

In Day 1, we explored what Machine Learning is and how computers can learn from data instead of relying entirely on explicitly programmed instructions.
But did you know that Machine Learning is not just one technique?
There are different approaches to teaching machines how to learn. Depending on the type of data available and the problem we want to solve, Machine Learning is mainly divided into three major categories:
  1. Supervised Learning
  1. Unsupervised Learning
  1. Reinforcement Learning
Let's understand each one with simple, real-world examples.

1. Supervised Learning

Supervised Learning is a type of Machine Learning where a model learns using labeled data.
Labeled data means that every training example contains an input along with its correct output.
The model studies these examples and learns the relationship between inputs and outputs. Later, it uses that knowledge to predict results for new data.
Real-world example: Email Spam Detection
Imagine training an email detection system.
  • Input: Email content.
  • Label: Spam or Not Spam.
  • Learning: The model identifies patterns in spam emails.
  • Output: It predicts whether a new email is spam.
Two major types:
  • Regression: Predicts continuous numerical values, such as house prices.
  • Classification: Predicts categories, such as spam or not spam.

2. Unsupervised Learning

Unlike supervised learning, Unsupervised Learning works with unlabeled data.
Here, the model is not given the correct answers. Instead, it independently identifies patterns, similarities, relationships, and structures within the dataset.
Real-world example: Customer Segmentation
Imagine an online shopping platform with thousands of customers.
The platform can use unsupervised learning to group customers based on:
  • Shopping habits.
  • Purchase frequency.
  • Product preferences.
  • Spending patterns.
The algorithm discovers customer groups without being told beforehand what those groups should be.
Popular techniques:
  • Clustering: Groups similar data points.
  • Association: Identifies relationships between items.
  • Dimensionality Reduction: Reduces the number of features while preserving useful information.

3. Reinforcement Learning

Reinforcement Learning is a different approach where a machine learns through trial and error.
An agent interacts with an environment, performs actions, and receives rewards or penalties based on its decisions.
Over time, it learns which actions produce better results.
Real-world example: Self-Driving Cars
Imagine an autonomous vehicle learning how to navigate roads.
  • Agent: Self-driving car system.
  • Environment: Road and surrounding traffic.
  • Action: Accelerate, brake, or turn.
  • Reward: Safe and efficient driving.
  • Penalty: Unsafe actions or collisions.
The system learns to make better decisions through repeated interactions.
Important concepts:
  • Agent: The learner or decision-maker.
  • Environment: The world in which the agent operates.
  • Action: A decision made by the agent.
  • Reward: Feedback received after an action.

Comparison of the Three Types

Feature
Supervised
Unsupervised
Reinforcement
Data
Labeled
Unlabeled
Interaction feedback
Learning
Input-output examples
Hidden patterns
Trial and error
Goal
Make predictions
Discover structure
Maximize rewards
Example
Spam detection
Customer grouping
Game-playing AI

Where Are These Used in Real Life?

  • Supervised Learning: Medical image classification, house price prediction, fraud detection.
  • Unsupervised Learning: Customer segmentation, anomaly detection, recommendation analysis.
  • Reinforcement Learning: Robotics, autonomous navigation, game-playing systems.

Conclusion

Machine Learning becomes easier to understand when we know how machines learn.
Supervised Learning teaches machines using examples with correct answers. Unsupervised Learning helps machines discover hidden patterns. Reinforcement Learning teaches machines through actions, rewards, and experience.
Understanding these three approaches gives us a strong foundation for exploring practical Machine Learning algorithms.
In our next article, we'll take a closer look at Day 3: Understanding the Machine Learning Workflow – From Data Collection to Model Deployment.

Series: Machine Learning From Scratch (18 articles)

  1. 2
    Machine Learning from Scratch – Day 2: Understanding the Types of Machine Learning This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article