A4 · concepts to know
The interactive demos cover the algorithms. These are the rest of the A4 syllabus: the kinds of machine learning, the hardware it runs on, the ethics, and the higher-level data and model topics. Short, exam-aligned, and linked to a demo wherever one exists.
A4.1.1 asks you to describe each type and a real-world use. Most have a demo here.
Learns from labelled examples, where each input comes with its known answer, then predicts the answer for new inputs. Used for classification (discrete labels, like marking an email as spam or not) and regression (continuous values, like predicting a house price).
k-NN demoFinds structure in data that has no labels, for example by grouping similar items into clusters. Nobody says what the right answer is; the algorithm finds the pattern. Shops use it to segment customers into groups with similar buying habits.
k-means demoAn agent learns by acting in an environment and collecting reward or penalty, gradually preferring the actions that pay off. No examples, just consequences. It is how game-playing systems and robots learn: try, score, adjust, repeat.
grid-world demoNeural networks with many layers that learn their own features from raw data, rather than being told what to look for. It powers image and language models.
CNN demoTake a model already trained on a large task and reuse it as the starting point for a smaller, related task. It saves data and time because the early features carry over. A real case: start from a general image model and retrain just the final part to spot plant diseases from a few hundred photos.
A4.1.2 asks which hardware fits which deployment scenario, and why.
Graphics processors do thousands of simple calculations at once, which suits the matrix maths of training. The everyday workhorse for ML.
practise the GPU questionTensor Processing Units are chips Google designed specifically for the tensor operations in neural networks, trading generality for speed and efficiency.
Application-Specific Integrated Circuits are built to do one job extremely fast and on very little power, but cannot be reprogrammed for another. That fits mass-produced devices running a fixed model on a tight power budget, like the AI chip in a phone. A TPU is a kind of ASIC.
Field-Programmable Gate Arrays sit between a CPU and an ASIC: reconfigurable hardware you can rewire for a task, faster than software but more flexible than a fixed chip. Choose one when you need hardware speed but the design may still change, for example when prototyping a chip or running a model that will be updated in the field.
Rent large amounts of compute on demand, or use a high-performance computing cluster, when a training run is too big for one machine.
A4.4 asks you to discuss real ethical implications, not just list them. Two app surfaces let you feel them.
Accountability, fairness, bias, consent, privacy, security, and environmental impact. A model can be accurate overall yet treat one group unfairly, which is the heart of the fairness problem.
accuracy-vs-fairness demoEthical reasoning is a skill you practise, not a list you memorise. Take a side and defend it on a real ML scenario.
Ethics CourtAs AI, AR, VR and quantum computing reach further into everyday life, weigh individual rights, privacy and equity against the benefits. Who gains, who is exposed, and who decides.
The HL-only A4 topics that the demos do not cover directly.
Real data is messy: missing values, duplicates, inconsistent formats, outliers. Cleaning it first matters because a model can only learn from the data it is given, errors and all.
Choosing which inputs to keep. Filter methods score features on their own, wrapper methods test them against the model, and embedded methods select while training. Fewer, better features give simpler, faster, more general models.
Squeezing many features into fewer while keeping the signal, so models train faster and overfit less. (The specific methods PCA and LDA are beyond the syllabus; the idea is what matters.)
Predicts a category by asking a chain of simple questions about the features, one split at a time, until it reaches a leaf that holds the answer. It learns by picking, at each split, the question that best separates the classes in the training data. A human can read the whole tree and follow why it decided, and the syllabus pairs it with k-NN as the two classification techniques to know.
Hyperparameters are the settings you choose before training rather than values the model learns: k in k-NN, the polynomial degree, the learning rate. Tuning means trying values and comparing the results on held-out test data, using metrics like accuracy, precision, recall and F1, to find the setting that generalises best. Every slider in these demos is a hyperparameter.
metrics demoUncovers "when this, often that" relationships between attributes across many records, the classic example being items frequently bought together. The technique scans the records for combinations that appear together, writes them as if-then rules (if bread and butter, then milk), and keeps the rules that occur often enough (support) and hold reliably enough (confidence).
There is no single best algorithm for every problem. Compare candidates fairly, on held-out data and by the metric that matters for the task, then choose with the tradeoffs in mind.
metrics demo