A4.1.1 — Types of Machine Learning

← Back to A4.1 overview

What is Machine Learning?

A subfield of artificial intelligence focused on developing algorithms and statistical models that enable computers to perform tasks without explicit instructions. ML models learn from data, improve over time, and can make predictions, classify data, and identify patterns.

The Five Types

Supervised Learning (SL)

Trains on a labelled dataset where inputs and correct outputs are both known. The model learns to map inputs to outputs and can predict results for new data.

  • Classification: Output is a category (e.g. spam or not spam, disease or no disease).
  • Regression: Output is a continuous value (e.g. house price prediction).

Use when: you have labelled training data and a specific output to predict.

Unsupervised Learning (UL)

Trains on data without labels. The model finds hidden patterns, groupings, or structures in the data on its own.

  • Cluster analysis: Groups similar data points together.
  • Also includes dimensionality reduction, density estimation, market basket analysis.

Use when: data has no labels and you want to discover structure or patterns.

Reinforcement Learning (RL)

An agent learns by taking actions in an environment and receiving rewards or penalties. It maximises cumulative reward over time through trial and error.

  • Balances exploitation (using what it knows) and exploration (trying new actions).

Use when: the problem involves sequential decisions, interaction with an environment, or game playing.

Deep Learning (DL)

A subset of ML using artificial neural networks with many layers (hence "deep"). Each layer learns increasingly abstract features from the input data.

  • CNN (Convolutional Neural Network): Specialised for image data. Detects spatial patterns and hierarchies of features.
  • RNN (Recurrent Neural Network): Specialised for sequential data (text, audio). Maintains memory of previous inputs.
  • LSTM (Long Short-Term Memory): A type of RNN that handles long-range dependencies well.
  • Transformer: Uses self-attention to weigh the importance of all parts of the input simultaneously. Basis for models like BERT and GPT.

Use when: dealing with complex data like images, audio, or text where feature extraction is needed at scale.

Transfer Learning (TL)

A model pre-trained on one task is reused as the starting point for a different but related task. The model brings already-learned features and is fine-tuned on the new task.

  • Reduces the need for large labelled datasets for every new task.
  • Common in computer vision and NLP where pre-training on huge datasets is expensive.
  • Example: BERT pre-trained on general text, fine-tuned for sentiment analysis.

Use when: you have limited labelled data for a specific task but a related large dataset exists.

Quick Comparison

TypeData neededGoalKey use cases
SupervisedLabelledPredict output from inputMedical diagnosis, spam filter, image classification
UnsupervisedUnlabelledFind hidden structureMarket basket analysis, customer segmentation
ReinforcementEnvironment feedbackMaximise cumulative rewardRobotics, game playing, autonomous vehicles
Deep LearningLarge labelled datasetsLearn complex feature hierarchiesImage recognition, NLP, speech recognition
TransferPre-trained model + small task datasetAdapt existing model to new taskMedical imaging, NLP fine-tuning

Key Terms

  • Labelled data: Dataset where each instance is tagged with one or more labels identifying its features or classifications.
  • Classification: Categorising data into predefined groups or classes.
  • Tensor: A way to represent data in multiple dimensions. A single number is a 0D tensor, a list is 1D, a table is 2D. Deep learning models operate on tensors.
  • Neural network: A computational model inspired by the human brain, consisting of layers of interconnected nodes (neurons) that process data and learn patterns.
  • Training: The process of feeding data to a model and adjusting its parameters to minimise error and improve predictions.
Ninja Note: The exam often asks you to justify which learning paradigm suits a given scenario. The key questions: Is the data labelled? (Supervised.) Are you discovering patterns with no labels? (Unsupervised.) Does it involve decisions in an environment with rewards? (Reinforcement.) Is image or sequential data involved at scale? (Deep learning.) Is data scarce but a related model exists? (Transfer learning.)