What is Machine Learning?
Definition
Machine learning is the branch of artificial intelligence in which computers learn patterns from example data, rather than following explicitly written rules, in order to make predictions or decisions. A model adjusts its parameters on training data and is expected to generalise to data it has never seen. Spam filters, recommendation systems, demand forecasting, fraud detection and large language models are all applications of machine learning.
Also known as: ML, statistical learning, predictive modelling, ML model

Showing examples instead of writing rules
In conventional software a developer writes the rule: “if the subject line contains these words, move the email to spam.” Rules multiply, maintenance gets painful, and spammers simply change their wording. In machine learning you label thousands of emails as spam or not spam and show them to a model, which works out for itself which combinations of features point to spam. When a new email arrives, it estimates a probability from the patterns it learned.
The key idea is generalisation. The goal isn't to memorise the training examples but to make good decisions on examples nobody has seen yet.
Three classic types of learning
| Type | Data | Examples |
|---|---|---|
| Supervised | Labelled examples with known answers | Spam detection, house-price prediction, churn prediction |
| Unsupervised | Unlabelled data | Customer segmentation, spotting unusual transactions |
| Reinforcement | Rewards and penalties for actions | Game-playing systems, robot control |
Pre-training a large language model doesn't fit neatly into the table. It is usually called self-supervised learning: no human supplies labels, because the text provides them. The model tries to predict what comes next, and the right answer is already in the text. The fine-tuning that follows is closer to supervised learning again.
Training and testing a model, step by step
Take an online shop that wants to predict which customers will stop buying in the next three months:
- Prepare the data: collect features of past customers (order frequency, days since last purchase, return rate) and whether they eventually churned.
- Split it: separate training, validation and test sets. The test set stays hidden from the model until the final evaluation.
- Train: the model adjusts its parameters to shrink the gap between its predictions and the real outcomes, measured by a loss function.
- Evaluate properly: accuracy alone misleads. If only 5% of customers churn, a model that predicts “stays” for everyone scores 95% accuracy and is useless, which is why precision and recall matter.
- Monitor: customer behaviour drifts. A deployed model whose performance isn't measured regularly degrades without anyone noticing.
A model that does brilliantly on training data and poorly on new data is overfitting: it has memorised rather than learned.
AI, machine learning and deep learning
Think of nested circles. Artificial intelligence is the widest and includes rule-based systems. Machine learning is the set of methods that learn from data. Deep learning is machine learning with many-layered neural networks. The Transformer architecture and the large language models built on it are deep learning's most visible products today, and models that create content are grouped under generative AI.
When you don't need machine learning
- When the rules are clear and few. Nobody trains a model to calculate VAT or a shipping rate table.
- When there isn't enough representative data. A model trained on a few dozen examples can do worse than a sensible rule.
- When every decision must be explained. In some domains, explainability is worth more than a few points of accuracy.
The healthy way to add machine learning to a custom software project is to build a simple rule-based or statistical baseline first and require the model to beat it.

