Machine learning is a branch of artificial intelligence in which software learns patterns from examples in data, then uses those patterns to make predictions or decisions, rather than following rules a programmer wrote out by hand.
For most of computing history, getting a computer to do something meant spelling out every step. A programmer wrote explicit instructions, and the machine followed them exactly. That works well for tasks with clear rules, like adding numbers or sorting a list. It breaks down for messier problems, such as recognising a face in a photo or flagging a fraudulent transaction, where the rules are hard to state and full of exceptions. Machine learning takes a different route: instead of telling the computer the rules, you show it many examples and let it work out the patterns itself.
How does machine learning actually work?
The general recipe is easier to grasp than the mathematics behind it. You start with data, feed it to an algorithm, and the algorithm produces a model, which is essentially a set of learned settings that map inputs to outputs. You then test the model on data it has not seen to check whether it has genuinely learned something useful or merely memorised the examples.
Imagine you want software that estimates a home’s price. You gather thousands of past sales, each described by features such as floor area, number of bedrooms and location, alongside the price it sold for. The learning process adjusts the model repeatedly so its price estimates get closer to the real figures. Once trained, the model can estimate the price of a home it has never encountered. Nobody wrote a rule saying “add a fixed amount per bedroom”; the relationship was learned from the data.
This data-driven approach is what connects machine learning to the wider world of artificial intelligence. It is also why data quality is so central: a model trained on incomplete or skewed examples will make skewed predictions, however clever the algorithm.
What are the main types of machine learning?
Practitioners usually group methods into three broad families, based on the kind of feedback the system receives while it learns.
| Type | What it learns from | Typical uses |
|---|---|---|
| Supervised learning | Labelled examples, where each input comes with the correct answer | Spam detection, price estimation, medical image triage |
| Unsupervised learning | Unlabelled data, where the system finds structure on its own | Customer segmentation, anomaly detection, grouping similar documents |
| Reinforcement learning | Trial and error, guided by rewards and penalties from an environment | Game playing, robotics, some control and scheduling systems |
In supervised learning, the model is shown inputs paired with the desired output and learns to predict that output for new inputs. The United States National Institute of Standards and Technology describes it, in its AI glossary, as learning to predict labels or output values for data. Unsupervised learning works without those labels, hunting instead for natural groupings or unusual points. Reinforcement learning is different again: an agent interacts with a dynamic environment, such as a game or a simulated task, and improves by maximising rewards over time.
Where do you already meet machine learning?
You probably encounter it dozens of times a day without noticing. Email services use it to filter spam. Streaming platforms and online shops use it to recommend what to watch or buy. Banks use it to spot suspicious transactions. Phone cameras use it to sharpen photos and recognise faces, and voice assistants use it to turn speech into text. Navigation apps lean on it to predict traffic and estimate arrival times.
Much of the recent public excitement, though, comes from deep learning, a subset that uses layered artificial neural networks. These systems can learn directly from raw images, audio and text, and they underpin the large models behind today’s chatbots and image generators. If you want a grounded sense of what those tools can and cannot do, our companion piece on what generative AI can and cannot do is a useful reality check.
What is the difference between training and prediction?
It helps to separate two phases. Training is the learning stage, where the model digests examples and adjusts its internal settings; it can be computationally demanding and is usually done in advance. Prediction, sometimes called inference, is when the finished model is put to work on new inputs, which is typically fast. A photo app might spend enormous resources training a model once, then run predictions instantly on your phone every time you take a picture.
Crucially, a model does not understand the world the way a person does. It captures statistical relationships in its training data. When new situations resemble that data, predictions tend to be reliable. When conditions drift, say, shopping habits change or a sensor behaves differently, accuracy can quietly degrade, which is why deployed models are monitored and periodically retrained.
What are the limits and risks?
Machine learning is powerful but not magic, and its weaknesses are as important as its strengths. Because a model learns from historical data, it can absorb and repeat the biases in that data, producing unfair outcomes if used carelessly for decisions about people. Models can also be confidently wrong on inputs unlike anything they were trained on. Many complex models are hard to interpret, making it difficult to explain exactly why a particular prediction was made, a real concern in areas like lending, hiring or healthcare.
None of this means the technology should be avoided. It means it should be used with the same care as any other consequential tool: clear about the problem, honest about the data, and paired with human judgement where the stakes are high. For a broader look at how these systems fit into computing and society, our technology section follows the practical developments as they unfold.
Frequently asked questions
Is machine learning the same as artificial intelligence?
No. Artificial intelligence is the broad goal of building systems that perform tasks we associate with human intelligence. Machine learning is one approach within AI, in which a system improves at a task by learning statistical patterns from data rather than following rules a programmer wrote by hand.
Does machine learning require huge amounts of data?
It depends on the task. Some methods work reasonably well with modest, well-labelled datasets, while modern deep learning models generally need very large collections of examples. In every case, the quality and representativeness of the data matter more than raw volume alone.
What is the difference between machine learning and deep learning?
Deep learning is a subset of machine learning that uses layered artificial neural networks. These networks can learn complex features directly from raw data such as images, audio or text, which is why deep learning powers many recent advances, including generative AI.
Can machine learning models be wrong or biased?
Yes. A model can only learn from the data it is given, so gaps, errors or historical bias in that data can be reproduced or amplified in its predictions. This is why testing, monitoring and human oversight matter, especially for decisions that affect people.
Do I need to know how to code to understand machine learning?
No. The core idea, learning patterns from examples to make predictions, can be understood without programming. Building and deploying models does involve technical skills, but grasping what machine learning does and where its limits lie requires only clear concepts, not code.




