A4.1 · Book pp. 206–214
Machine learning fundamentals
Instead of writing every rule by hand, we show a computer examples and let it find the rules. This section explains the main ways of doing that, and the hardware they need.
What you need to know
- A4.1.1 Describe the types of machine learning and their real-world applications.
- A4.1.2 Describe the hardware requirements for various scenarios.
Both are for SL and HL. Precise terms matter here, since a term used in the wrong context costs marks.
AI, ML and deep learning
- Artificial intelligence imitates human intelligence. Narrow AI does specific tasks and is all that exists today. General AI would work at human level across domains.
- Machine learning learns from data without being explicitly programmed.
- Generative AI produces text, images, audio or video, usually from a prompt.
A4.1.1 Types of machine learning
| Type | Learns from | Result | Examples |
|---|---|---|---|
| Supervised | Labelled examples: inputs with the right answers | Predicts a number (regression) or a category (classification) | Grade prediction, spam filters, handwriting |
| Unsupervised | Data with no labels | Finds patterns and groups by itself | Social groups, shopping patterns, recommendations |
| Reinforcement | Trial and error, with rewards as feedback | Improves its decisions over time | Game bots, robots, self-driving, trading |
| Transfer | A trained model, adapted to a related task | Needs far less data and time | General image model tuned to recognize flowers |
| Deep learning | Neural networks with many layers | Extracts higher-level features layer by layer | Image and speech recognition |
✏️ Book note
The book says “deep learning” implies a neural network. More exactly, “deep” means a network with many hidden layers, as its own common-mistake box says. The term has nothing to do with deep understanding.
⚠️ Common mistakes
- Deep learning is part of machine learning, not separate from it.
- Regression gives numbers, and classification gives categories.
- Transfer learning means adapting a model to a related task, not just reusing it unchanged.
A4.1.2 Computing platforms
Exact models will change, so learn the categories and the trade-offs.
| Platform | Best for | Advantage | Limitation |
|---|---|---|---|
| Standard laptop | Learning, small models | Cheap and available | Too slow, with limited memory for big models |
| Workstation with GPU | Serious individual projects | Often around 10× faster than a CPU alone | Costs more up front |
| Edge device | Processing next to the data | Less data sent, so better privacy and latency | You buy and maintain the hardware |
| Cloud platform | Training and deploying large models | Scales on demand, and no hardware to own | Dependence on a provider, security trust, ongoing cost |
| HPC centre | Large scientific research | Sustained, very high performance | Restricted access through membership or grants |
✍️ Try it
Google Colab lets you run a Python notebook on a GPU or TPU. Change the setting in its Runtime menu, then compare how long a matrix calculation takes.
A4.1.2 Processors for machine learning
| Chip | Built for | Strength | Weakness |
|---|---|---|---|
| CPU | General purpose | Flexible, handles complex tasks | Weak at heavy parallel work |
| NPU | Neural network maths on consumer devices | Fast and low power | Limited to smaller workloads |
| GPU | The same calculation on many values at once | Excellent at matrix and vector maths | Costly and power-hungry |
| TPU | Google’s chip for tensor maths at low precision | Very efficient at huge matrix work | Tied to certain platforms |
| ASIC | Custom chip for one fixed task | Peak speed and efficiency, cheap at scale | High design cost, cannot be reprogrammed |
| FPGA | Reprogrammable hardware | Balances flexibility and efficiency | Harder to program, and less efficient than an ASIC |
scalar (0D) → vector (1D) → matrix (2D) → tensor (3D or more)
✏️ Book note
The book says a CPU must queue calculations one by one. Modern CPUs do have several cores and some parallel instructions, but only a handful of cores compared with a GPU’s thousands. That is the difference to describe.
Quick quiz
Exam-style questions
These are written for this site in the style of Paper 1. Answer on paper first, then open the mark points.
-
Distinguish between regression and classification. [2]
Mark points
- Regression predicts a continuous numerical value [1].
- Classification predicts a category from a discrete set [1].
-
An email client sorts messages into Primary, Social and Spam. Identify the type of learning and justify your choice. [3]
Mark points
- Supervised learning [1].
- It is trained on emails labelled with the correct folder [1].
- It then generalizes to place new, unseen emails in a known category [1].
-
A self-driving model trained in one city is adapted for another. Define transfer learning, and outline how this example fits it, with one limitation. [4]
Mark points
- Transfer learning applies a trained model to a similar new problem [1].
- Skills such as recognizing cars and signs carry over [1].
- Only local fine-tuning is needed, which saves data and time [1].
- Limitation: different traffic rules or signs may reduce accuracy [1].
-
A start-up will process real-time data on a large scale. Identify suitable hardware and outline a limitation. [3]
Mark points
- A GPU [1].
- Its parallel cores process large amounts of data at once with low delay [1].
- Limitation: high purchase and energy costs [1].
-
A university wants to analyse lectures in real time. Compare using cloud GPUs and an on-site edge device. [4]
Mark points
- Cloud GPUs scale on demand [1], with no hardware to maintain [1].
- Edge devices keep video on-site, which helps privacy [1], and reduce latency and bandwidth use [1].