0.2 Types of Machine Learning★★★
PYQs4
- Discuss the different types of Machine Learning. 2022-23 6M recent
- What is unsupervised learning? → Learning from unlabelled data to find hidden patterns or groups 2024-25 1M recent
- The prior goal of an unsupervised learning model is to determine the ______. → Hidden patterns (structure or groupings) in the data 2023-24 1M recent
- Fraud detection, image classification, diagnostics and customer retention are applications of ______ learning. → Supervised 2023-24 1M recent
Three Ways to Learn
- A child learns fruit names when a parent points and says "apple".
- Later, she sorts toys into groups that nobody named for her.
- And she learns to ride a bicycle by falling and trying again.
- Machines learn in the same three ways.
Types of Machine Learning PYQ 6M
flowchart TD
A["<b>Data</b>"]:::blue --> B{"Labelled<br>examples?"}:::amber
B -->|"Yes"| C["<b>Supervised</b>"]:::green
B -->|"No"| D{"Learns from<br>rewards?"}:::amber
D -->|"Yes"| E["<b>Reinforcement</b>"]:::green
D -->|"No"| F["<b>Unsupervised</b>"]:::green
classDef blue fill:#5b84d424,stroke:#5b84d480
classDef amber fill:#d6a24424,stroke:#d6a24480
classDef red fill:#d0707024,stroke:#d0707080
classDef green fill:#52a86e24,stroke:#52a86e80Supervised Learning
Supervised learning is learning from labelled data: each example has an input x and the correct output y, and the model learns the mapping x → y.
- Like a student learning with an answer key.
Two kinds (→ 1.1)
- Classification: output is a category. Example: spam / not spam; disease yes / no.
- Regression: output is a number. Example: house price; tomorrow's temperature.
Algorithms: linear and logistic regression, KNN, decision trees, Naive Bayes, SVM.
Unsupervised Learning PYQ 1M
Unsupervised learning is learning from unlabelled data, where the goal is to find hidden structure, patterns or groupings.
- No answer key; the model discovers structure on its own.
Main tasks
- Clustering: group similar items. Example: customer segmentation (→ 2.1).
- Dimensionality reduction: compress many features into few (→ 2.4).
- Association rules: find items that occur together. Example: "bread → butter" in shopping baskets.
Algorithms: K-means, hierarchical clustering, PCA, Apriori.
Reinforcement Learning
Reinforcement learning (RL) is learning by trial and error: an agent acts in an environment and learns from rewards and penalties to maximise total reward (→ 5.4).
- Examples: game-playing AI (AlphaGo), robot navigation, self-driving decisions.
Other Types
- Semi-supervised learning: a few labelled examples plus many unlabelled ones (→ 5.2).
- Example: a photo app labels a few faces you tag, then groups the rest.
- Active learning: the model asks a human to label the most useful examples (→ 5.3).
- Online learning: the model updates continuously as new data arrives (→ 5.1).
- Example: a stock-price model updated every minute.
Supervised vs Unsupervised vs Reinforcement
| Basis | Supervised | Unsupervised | Reinforcement |
|---|---|---|---|
| Data | labelled (x, y) | unlabelled (x only) | no fixed dataset; experience from actions |
| Feedback | correct answer for every example | none | reward or penalty after actions |
| Goal | predict outputs for new inputs | find hidden patterns | maximise total reward |
| Tasks | classification, regression | clustering, dimensionality reduction, association | control, decision sequences |
| Algorithms | regression, KNN, trees, SVM | K-means, PCA, Apriori | Q-learning, policy gradients |
| Example | spam detection | customer segmentation | game playing, robots |
Matching Applications to Types PYQ 1M
| Application | Type | Why |
|---|---|---|
| fraud detection | supervised | past transactions labelled fraud / genuine |
| image classification | supervised | images labelled with classes |
| medical diagnostics | supervised | records labelled with diagnosis |
| customer retention (churn) | supervised | past customers labelled stayed / left |
| customer segmentation | unsupervised | no labels; find groups |
| targeted marketing groups | unsupervised | group by behaviour |
| market basket analysis | unsupervised | find items bought together |
| game AI, robot navigation | reinforcement | learn by rewards |
Choosing the Type: A Movie-Review Dataset
- Situation: historical movie reviews, each with a class label (positive / negative).
- Choice: supervised learning, classification (sentiment analysis).
- Why:
- Every review already has the correct label, so the model can learn from the answer key.
- The output is a category, so it is classification, not regression.
- Suitable algorithms: Naive Bayes (→ 1.7), logistic regression, SVM.
- Without labels, the same reviews could only be grouped by clustering (unsupervised).
⚡ Quick recall
- Supervised? → labelled data, learn x → y · classification (category) and regression (number)
- Unsupervised? → unlabelled data · goal: hidden patterns / structure / groups · clustering, dimensionality reduction, association
- Reinforcement? → agent, actions, rewards, trial and error
- Others? → semi-supervised · active · online
- Fraud, image classification, diagnostics, retention? → supervised
- Labelled movie reviews? → supervised classification (sentiment)