What Machine Learning Is

IB Syllabus: A4.1.1: Describe the types of machine learning and their applications (supervised, unsupervised, reinforcement, deep, and transfer learning). A4.1.2: Describe the hardware requirements for machine learning (ASICs, FPGAs, GPUs, TPUs, cloud platforms, HPC centres). SL and HL. A4.3.8 (HL): Outline the structure and function of ANNs (single perceptron, multi-layer perceptron), covered in the perceptron section below.

Table of Contents

  1. Why This Page Exists
  2. Learning From Data: the Core Idea
    1. The Vocabulary You Need
  3. The Five Types of Machine Learning
    1. Supervised learning
    2. Unsupervised learning
    3. Reinforcement learning
    4. Deep learning
    5. Transfer learning
  4. How a Model Actually Learns: the Perceptron (HL)
  5. The Hardware Machine Learning Runs On
  6. Where This Goes Next
  7. Quick Check
  8. Match the Type of Learning
  9. Practice Exercises
    1. Core
    2. Extension
    3. Challenge
  10. Connections

Why This Page Exists

For most of computing’s history, to make a computer do something you wrote the rules: if this, then that, spelled out step by step. That works brilliantly when you can state the rules. It falls apart when you cannot. Nobody can write down the exact rules that separate a photo of a cat from a photo of a dog, or a spam email from a real one. The rules are real, but they are too subtle and too numerous to write by hand.

Machine learning is the answer to that problem. Instead of writing the rules, you show the computer thousands of examples and let it work out the rules for itself. That single shift, from programming the rules to learning the rules from data, is what this whole topic is about, and it is what makes everything from voice assistants to medical image screening possible.


Try it yourself: the machine learning simulators let you train real models in your browser and watch them learn. Every concept on these pages links to one. (They live on the companion app; a student login is needed.)

Learning From Data: the Core Idea

Traditional program: a human writes rules, the computer applies them. Machine learning turns this around: a human provides examples, and the computer produces the rules (in the form of a model) by finding the patterns in those examples.

Classical programming Rules Data Program Answers Machine learning Examples Answers Training Learned rules (the model)

Classical programming needs a human to supply the rules up front. Machine learning reverses the flow: examples and their answers go in, and the rules come out as the model.

A spam filter makes the difference concrete. The old way was to write rules by hand (“if the subject contains ‘free money’, mark as spam”), which spammers dodged in minutes. The machine learning way is to show a system a large collection of emails already marked “spam” or “not spam”, and let it learn the patterns that separate the two. When a new email arrives, the model predicts which it is. Nobody wrote the rule; the data taught it.

The Vocabulary You Need

These words appear on every page in this topic. Learn them precisely.

Term Meaning In the spam example
Data / dataset The examples the system learns from The collection of past emails
Feature One measurable input the model looks at Words used, sender, number of links
Label The correct answer attached to a training example “spam” or “not spam”
Model The thing that has learned the pattern and makes predictions The trained spam filter
Training The process of adjusting the model using the data Learning from the marked emails
Prediction The model’s output for a new, unseen input “this new email is spam”

The whole process is a loop: training data with features (and sometimes labels) goes in, training produces a model, and the model makes predictions on new data. Keep that shape in mind and the rest of the topic hangs off it.

What Is Artificial Intelligence? (Crash Course AI #1, 12 min)
What Is Artificial Intelligence? (Crash Course AI #1, 12 min)

A friendly overview of what artificial intelligence and machine learning are, built around the same shift this page describes: from hand-written rules to systems that learn from examples. A good way into the real-world applications the syllabus asks about, such as recognising objects in images and processing natural language.


The Five Types of Machine Learning

The syllabus names five types. The first three describe how a system learns; the last two describe approaches that can be layered on top. Knowing the difference between them, and a real use for each, is the core of A4.1.1.

Three ways a system can learn Supervised learns from labelled examples Unsupervised finds structure in unlabelled data Reinforcement learns from reward and penalty Approaches that cut across all three Deep learning many-layered neural networks, a way of building the model Transfer learning start from a model already trained on a related task

The three boxes are the ways a system can learn. The two bars underneath cut across all of them: deep learning is a way of building the model itself, and transfer learning is a way of starting from a model someone has already trained.

Supervised learning

In supervised learning, the system learns from examples that are labelled with the correct answer. It sees many inputs paired with their right output, and learns to predict the output for new inputs. This splits into classification (predicting a category, such as spam or not-spam) and regression (predicting a number, such as a house price).

Application: diagnosing disease from medical scans labelled by doctors, filtering spam, predicting prices.

Unsupervised learning

The system learns from data with no labels. Nobody tells it the right answer; its job is to find structure on its own, most often by clustering similar items together or spotting things that do not fit.

Application: grouping customers into segments for marketing, detecting unusual bank transactions as possible fraud, discovering topics in a pile of documents.

Reinforcement learning

The system learns by trial and error, acting in an environment and receiving rewards or penalties. Over many attempts it learns a strategy that maximises its reward. No one shows it the right move; it discovers which moves pay off.

Application: game-playing agents that beat human champions, robots learning to walk, controlling systems like traffic lights or data-centre cooling.

Deep learning

Deep learning is a subset of machine learning, not a separate rival to it. It uses artificial neural networks with many layers, which lets it learn very complex patterns directly from raw data like images, sound, and text. It usually needs a lot of data and a lot of computing power.

Application: image and face recognition, speech-to-text, and the large language models behind modern generative AI.

Common confusion: deep learning is not “better machine learning” or a separate field. It is one family of techniques within machine learning, defined by its use of many-layered neural networks. A supervised task can be solved with deep learning or without it.

Transfer learning

Transfer learning reuses a model already trained on one task as the starting point for a related task, then adapts it with a smaller amount of new data. It is powerful because training from scratch is expensive; standing on the shoulders of an existing model saves enormous time and data.

Application: taking a huge image model trained on millions of general photos and adapting it, with only a few hundred examples, to recognise a specific crop disease.

Common confusion: transfer learning is not simply “copying a model and running it”. It is adapting an already-trained model to a new but related problem. The reuse of learned knowledge is the whole point; running an unchanged model is just using it.


How a Model Actually Learns: the Perceptron (HL)

HL Only. The single perceptron is HL content (A4.3.8), included here as a first look at how learning happens. Standard level students can skip to the hardware section.

It is fair to ask: when we say a model “learns”, what actually changes? The simplest answer is a perceptron, the smallest unit that learns, and a rough model of a single brain cell (neuron).

A perceptron takes some inputs, multiplies each by a weight, adds them up, and outputs a decision. Learning means adjusting those weights: every time it gets an example wrong, it nudges its weights so it is a little more likely to be right next time. Repeat that over many examples and the weights settle into a pattern that separates the classes. That nudging-toward-less-wrong is, at heart, what all model training does.

A single perceptron can only separate data with a straight line, so it cannot solve problems like XOR. Stacking perceptrons into layers removes that limit: in a multi-layer perceptron (MLP), an input layer receives the data, one or more hidden layers combine and transform it, and an output layer gives the decision, each neuron passing its result forward to the next layer. This layered structure is the foundation of deep learning, which the training and evaluating page builds on.

Single perceptron x1 x2 x3 w1 w2 w3 Σ weighted sum threshold output Multi-layer perceptron input layer hidden layer output layer

Left: a single perceptron multiplies each input by its weight, adds the results, and applies a threshold to decide the output. Right: the same kind of unit stacked into layers; every node feeds every node in the next layer, and learning adjusts the weight on every connection.

Neural Networks and Deep Learning (Crash Course AI #3, 11 min)
Neural Networks and Deep Learning (Crash Course AI #3, 11 min)

Shows how the hidden layers of a network combine simple features from earlier layers into more complex ones, until the output layer can make the final decision. It also explains why deep learning is called deep: the word simply means many hidden layers stacked between input and output.

For a deeper look at the same structure, 3Blue1Brown’s But what is a neural network? (18 min) draws the input, hidden, and output layers working on real handwritten digits.

Try it yourself: the perceptron simulator trains a single neuron on logic gates. Watch its boundary line rotate as it learns, and watch it fail forever on XOR until a hidden layer is added.


The Hardware Machine Learning Runs On

Training and running models takes serious computation, and the choice of hardware is a real engineering decision (A4.1.2). The key idea is that most machine learning is a mountain of simple calculations done at once, so hardware that does many things in parallel wins.

Hardware What it is Where it fits
CPU The general-purpose processor in every computer Fine for small models and everyday tasks; too slow for large training
GPU A graphics processor with thousands of cores doing maths in parallel The workhorse of ML training; great when many calculations run at once
TPU A Tensor Processing Unit: a chip designed by Google specifically for neural-network maths Very fast for large-scale training and serving of deep-learning models
ASIC An Application-Specific Integrated Circuit: a chip built for one fixed task, extremely efficient but not reprogrammable High-volume, unchanging workloads where efficiency matters most (a TPU is a kind of ASIC)
FPGA A Field-Programmable Gate Array: a chip that can be reconfigured after manufacture When you need custom hardware speed but must keep the flexibility to change it
Cloud platforms Renting any of the above by the hour, over the internet Getting powerful hardware without buying it; scaling up and down on demand
HPC centres High-performance computing: many machines linked as a supercomputer The largest models and research, where one machine is nowhere near enough

A rough way to choose: a GPU for general training, a TPU or ASIC for large fixed workloads where efficiency pays off, an FPGA when you need speed but also the freedom to reconfigure, and cloud or HPC when you need more power than you own. The trade-off running through all of them is specialisation versus flexibility: the more a chip is built for one job, the faster and more efficient it is at that job, and the less it can do anything else.


Where This Goes Next

You now have the map: what machine learning is, the five types, and the hardware it runs on. The next two pages go deeper (mostly at HL):

And running alongside all of it: Ethics of Machine Learning, because every capability here comes with a responsibility question attached.

Curious where these applications actually lead? Three pages go behind the ones named above. None of them is examined; read them because you want to know. How Large Language Models Work is the natural language processing application taken apart. How AI Image Generation Works does the same for generative AI. AI Beyond Machine Learning shows the other half of the field, where robotics navigation is solved with almost no learning at all, which is the sharpest way to see what machine learning is for.


Quick Check

Q1. What most clearly distinguishes machine learning from traditional programming?

Q2. A system is trained on thousands of emails, each already marked "spam" or "not spam", so it can sort new ones. Which type of learning is this?

Q3. How does deep learning relate to machine learning?

Q4. A shop wants to group its customers into similar segments, but has no predefined categories and no labels. Which type of learning fits?

Q5. A team takes a large image model trained on millions of general photos and adapts it, using only a few hundred labelled examples, to spot a specific plant disease. This is:

Q6. Why are GPUs so widely used for training machine learning models?


Match the Type of Learning

Name the type of learning each scenario uses: supervised, unsupervised, or reinforcement.

Fill in the blanks.

// A model predicts house prices from past sales labelled with their price
// Type: 

// A program finds natural groupings in unlabelled customer data
// Type: 

// A game agent improves by trying moves and receiving points for winning
// Type: 

// A model learns to read handwritten digits from thousands of labelled images
// Type: 

Practice Exercises

Note for IB CS learners: A4.1 is examined with the Describe command term. The exercises below practise that, plus application. At least one asks for a full prose response.

Core

  1. Describe (6 marks): Describe three of the five types of machine learning, giving one original real-world application of each.

  2. Distinguish (4 marks): Explain the difference between supervised and unsupervised learning, using the idea of labels.

  3. Describe (4 marks): Describe two pieces of hardware used for machine learning and explain what makes each suitable.

Extension

  1. Explain (4 marks): Explain why deep learning is described as a subset of machine learning rather than a separate field.

  2. Apply (6 marks): For each situation, state which type of learning fits and why: (a) detecting unusual credit-card transactions, (b) teaching a robot arm to stack blocks, (c) sorting photos into “contains a face” or “does not”.

Challenge

  1. Discuss (8 marks): A start-up has a small amount of labelled data for a specialised image task and little money for hardware. Discuss how transfer learning and a sensible choice of hardware (including cloud) could make their project feasible. (Write in prose.)

Connections


© EduCS.me — A resource hub for Computer Science education

This site uses Just the Docs, a documentation theme for Jekyll.