Skip to main content

Types of Machine Learning

Objective​

This chapter explains the different types of machine learning. You will learn the difference between supervised, unsupervised, and reinforcement learning.


1. Supervised Learning​

What is it?​

Supervised learning is when we give the computer data with correct answers.

Simple example:

  • Like teaching a child with pictures
  • Show a picture of a cat and say "this is a cat"
  • Show a picture of a dog and say "this is a dog"
  • After a while, they learn the difference

How does it work?​

1. Data:

  • Pictures + labels
  • "This is a cat", "This is a dog"

2. Training:

  • The computer analyzes the pictures
  • Links pictures with labels

3. Application:

  • New picture without a label
  • The computer guesses what it is

Real-life examples​

Spam detection:

  • Give it emails + "spam" or "not spam"
  • It learns how to distinguish

Image recognition:

  • Give it pictures + labels
  • It learns how to recognize

Price prediction:

  • Give it data + prices
  • It learns how to predict

2. Unsupervised Learning​

What is it?​

Unsupervised learning is when we give the computer data without correct answers.

Simple example:

  • Like giving a child a set of objects
  • Without telling them what they are
  • They discover the groups themselves

How does it work?​

1. Data:

  • Data only
  • No labels or answers

2. Discovery:

  • The computer analyzes the data
  • Discovers patterns and groups

3. Organization:

  • Organizes data into groups
  • Based on similarity

Real-life examples​

Image organization:

  • Give it thousands of images
  • It organizes them by similarity

Pattern discovery:

  • Give it sales data
  • It discovers buying patterns

Clustering:

  • Give it customer data
  • Groups them into similar clusters

3. Reinforcement Learning​

What is it?​

Reinforcement learning is when the computer learns from trial and error with rewards.

Simple example:

  • Like teaching a dog new tricks
  • If it does the right thing → reward
  • If it does the wrong thing → no reward
  • Learns from experience

How does it work?​

1. Trial:

  • The computer tries something
  • Like: playing a game

2. Outcome:

  • If successful → reward
  • If failed → penalty

3. Learning:

  • Learns from experience
  • Tries to improve performance

Real-life examples​

Games:

  • Computer games
  • Learns how to play better

Smart cars:

  • Learns how to drive
  • From experience

Robots:

  • Learns how to walk
  • From trial and error

4. Comparison of Types​

Comparison Table​

TypeDataAnswersUsage
SupervisedData + AnswersYesRecognition, Prediction
UnsupervisedData onlyNoDiscovery, Organization
ReinforcementExperienceRewardsGames, Robots

5. When to Use Each Type?​

Supervised Learning​

Use it when:

  • You have data with answers
  • You want to predict something
  • You want classification

Example:

  • Email classification
  • Image recognition
  • Price prediction

Unsupervised Learning​

Use it when:

  • You have data without answers
  • You want to discover patterns
  • You want organization

Example:

  • Discovering customer clusters
  • Organizing images
  • Pattern discovery

Reinforcement Learning​

Use it when:

  • You want to learn from experience
  • You have an interactive environment
  • You want to improve performance

Example:

  • Games
  • Robots
  • Smart cars

6. Practical Examples​

In Our Daily Lives​

Supervised Learning:

  • Face recognition on phones
  • Product recommendations in shopping
  • Machine translation

Unsupervised Learning:

  • Automatic image organization
  • Discovering buying patterns
  • Grouping similar news

Reinforcement Learning:

  • Computer games
  • Smart cars
  • Robots

Conclusion​

  • There are three main types of machine learning
  • Each type has its uses
  • Supervised learning: Data + Answers
  • Unsupervised learning: Data only
  • Reinforcement learning: Learning from experience