What is machine learning, and how does learning from data differ from a traditional programmed solution?
Explain what machine learning is, how a model learns from training data, and how it differs from rule-based programming
A focused answer to the H2 Computing outcome on machine learning fundamentals. Learning a model from data rather than coding explicit rules, training and inference, features and labels, and the role of data quality.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
SEAB wants you to explain what machine learning is, how a model learns from training data, and how this differs from traditional rule-based programming. The central idea is a reversal of the usual approach: instead of a programmer writing explicit rules, the system learns the rules from examples, building a model that can then make predictions on new data.
The answer
Rule-based versus learned
In traditional (rule-based) programming, a human writes explicit instructions: given inputs, follow these rules to produce an output. This works when the rules are known and stable.
In machine learning, the system is given many examples and learns the patterns itself, producing a model that maps inputs to outputs. No human writes each rule; the rules are inferred from data. This suits problems where the rules are too complex, varied or changeable to write by hand (recognising images, filtering spam, predicting demand).
Training and inference
Machine learning has two phases:
- Training - the model learns its internal parameters from training data, adjusting them so its predictions match the known answers as closely as possible.
- Inference (prediction) - the trained model is applied to new, unseen data to make predictions.
A model is trained once (or periodically retrained) and then used many times for inference.
Features and labels
The training data is described by:
- Features - the input attributes the model uses (an email's number of links, a pixel's value, a house's size).
- Labels - the correct output for each training example (spam or not, the digit shown, the house price), in supervised learning.
The model learns to map features to the right output.
Data quality, bias and generalisation
A model learns only from the data it sees, so data is decisive:
- Quantity - too little data fails to capture the pattern reliably.
- Quality and bias - unrepresentative or biased data makes the model learn that bias, performing unfairly or inaccurately on under-represented cases.
A good model generalises - it is accurate on new, unseen data, not just the training set. A model that merely memorises the training data (and fails on new data) is said to overfit.
Examples in context
Example 1. Recommendation systems. A streaming service predicts what you will watch next not from hand-coded rules but from patterns learned across millions of users' viewing histories. As tastes and the catalogue change, the model is retrained on fresh data - adapting in a way that fixed rules never could.
Example 2. Why biased data harms a model. A hiring model trained mostly on data from one group can learn that group's patterns and judge others unfairly, because it only knows what its training data showed. This illustrates that representative, unbiased data is not optional - it directly determines whether the model is fair and accurate.
Try this
Q1. State the key difference between rule-based programming and machine learning. [2 marks]
- Cue. Rule-based programming has a human write explicit rules; machine learning learns the patterns (rules) from example data to build a model.
Q2. Define a feature and a label in a training dataset. [2 marks]
- Cue. A feature is an input attribute used to predict; a label is the correct output for a training example.
Q3. What does it mean for a model to generalise well? [1 mark]
- Cue. It makes accurate predictions on new, unseen data, not just the training examples (it has not overfit).
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original6 marks(a) Explain the difference between a traditional rule-based program and a machine learning approach to a task such as recognising spam email. (b) Define training and inference. (c) Why might machine learning succeed where explicit rules struggle?Show worked answer →
(a) A rule-based program uses explicit rules written by a programmer (for example, "if the subject contains 'free prize', mark as spam"). A machine learning approach instead learns patterns from examples: it is given many emails already labelled spam or not spam, and it builds a model that captures the statistical patterns distinguishing them, without a human writing each rule.
(b) Training is the process of learning the model's parameters from labelled (or unlabelled) training data. Inference (prediction) is using the trained model on new, unseen data to make a prediction (classify a new email as spam or not).
(c) Machine learning can succeed where rules struggle because spam is varied and constantly changing; no fixed set of hand-written rules can cover every case, and spammers adapt. A model learns subtle, combined patterns from data and can be retrained as spam evolves, generalising better than brittle explicit rules.
Markers reward the hand-coded-rules versus learned-from-examples contrast, correct training (learn from data) and inference (predict on new data) definitions, and ML generalising to varied/changing cases where fixed rules fail.
Original5 marks(a) Define the terms feature and label in a machine learning dataset. (b) Explain why the quality and quantity of training data strongly affect a model's performance, including the idea of bias in data. (c) What is meant by a model generalising well?Show worked answer →
(a) A feature is an input attribute the model uses to make a prediction (for example, the number of links in an email, or a pixel value). A label is the correct output for a training example (for example, "spam" or "not spam") that the model learns to predict.
(b) A model learns only from the data it is given, so poor or insufficient data leads to a poor model. Too little data means patterns are not captured reliably; biased data (unrepresentative of real cases) makes the model learn that bias and perform unfairly or inaccurately on under-represented cases. Good performance needs enough representative, accurately labelled data.
(c) A model generalises well when it makes accurate predictions on new, unseen data, not just the training examples - it has learned the underlying pattern rather than memorising the training set (which would be overfitting).
Markers reward feature (input attribute) and label (correct output) definitions, data quality/quantity and bias affecting performance, and generalisation as accuracy on unseen data (not memorising).
Related dot points
- Distinguish supervised, unsupervised and reinforcement learning, and identify classification, regression and clustering tasks
A focused answer to the H2 Computing outcome on types of machine learning. Supervised learning with labelled data (classification and regression), unsupervised learning with unlabelled data (clustering), reinforcement learning, and matching a task to a type.
- Describe an artificial neural network in terms of neurons, weights and layers, and explain how training adjusts weights
A focused answer to the H2 Computing outcome on neural networks. Artificial neurons with weighted inputs and an activation function, input, hidden and output layers, how training adjusts weights to reduce error, and what deep learning adds.
- Discuss the ethical and societal impacts of AI and automation, including bias, accountability, privacy and the effect on work
A focused answer to the H2 Computing outcome on AI ethics. Algorithmic bias, accountability and transparency, privacy and data use, the effect of automation on employment, and responsible approaches.
- Design test cases using normal, boundary and erroneous data, distinguish levels of testing, and apply systematic debugging techniques
A focused answer to the H2 Computing outcome on testing and debugging. Choosing normal, boundary and erroneous test data, unit and integration and system testing, black-box versus white-box, and systematic debugging.
- Analyse the time and space complexity of an algorithm using Big-O notation, and compare common growth rates
A focused answer to the H2 Computing outcome on algorithmic complexity. Big-O notation, deriving the order of growth from loops and recursion, the common complexity classes, and the trade-off between time and space.