Choosing a Type of Learning from the Data Available
This lesson explains how the learning approach depends on the data you have, labelled or not, and on what you want the model to do. The exam often describes a scenario and asks which type fits.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish supervised, unsupervised, semi-supervised and reinforcement learning.
- Distinguish structured, semi-structured and unstructured data.
- Explain the purpose of the training, validation and test sets.
Types of learning
Machine learning methods differ in the data they learn from. In supervised learning, each training example is labelled with the correct answer, and the model learns to map the inputs, called features, to that answer, called the label or target. It is used for classification, which predicts a category such as fraud or not fraud, and regression, which predicts a number such as a price. In unsupervised learning, the data has no labels, and the model finds structure on its own, such as groups of similar customers, unusual records or a simpler representation of the data.
In reinforcement learning (RL), an agent takes actions in an environment and learns from rewards and penalties to maximise its total reward, which suits robotics, games and resource optimisation. Self-supervised learning creates labels from the data itself, for example by hiding the next word in a sentence and predicting it; this is how large language models are pre-trained. Semi-supervised learning combines a small amount of labelled data with a large amount of unlabelled data, for when labels are scarce. The following table summarises the types.
| Type | Data | How it learns | Used for |
|---|---|---|---|
| Supervised | Labelled: each example has the correct answer | Maps inputs (features) to the answer (label or target) | Classification (a category) and regression (a number) |
| Unsupervised | Unlabelled | Finds structure on its own | Clustering, anomaly detection, dimensionality reduction (e.g. PCA) |
| Reinforcement (RL) | Rewards and penalties | An agent takes actions in an environment to maximise reward | Robotics, game playing, resource optimisation |
| Self-supervised | Unlabelled; labels come from the data itself | E.g. hides the next word and predicts it | Pre-training LLMs |
| Semi-supervised | A little labelled plus a lot of unlabelled | Combines both | When labels are scarce |
Labels are often the most expensive part of supervised learning, because people must create them, for example by marking thousands of images as damaged or undamaged. Labelling services such as Amazon SageMaker Ground Truth exist to organise that work. Reinforcement learning also has a role in generative AI: in reinforcement learning from human feedback (RLHF), people rank a model's responses, and those preferences become the reward that teaches the model to give helpful, harmless answers.
The following diagram contrasts the three main types of learning.

Which type of learning?
Types of data
Data is described by how strictly it is organised, and the type usually decides which approach works best. Structured data fits neatly into rows and columns, such as database tables, spreadsheets and time series like daily sales; classic machine learning handles it well. Semi-structured data, such as JSON, has some organisation but no fixed table layout, and either approach can be used. Unstructured data, such as documents, images, audio and video, has no predefined format; it is usually handled by deep learning and foundation models. The following table summarises the types.
| Type | Examples | Usually handled by |
|---|---|---|
| Structured | Database tables, spreadsheets, time series such as daily sales | Classic ML |
| Semi-structured | JSON | Either |
| Unstructured | Text documents, images, audio, video | Deep learning and foundation models |
How organised is the data?
Training, testing and fit
Available data is split into three sets so that a model can be judged fairly. The training set is the data the model learns from. The validation set is used during development to compare models and tune their settings. The test set is kept aside until the end and used once, to estimate how the model will perform on data it has never seen. If the test set influenced development, its score would be too optimistic. The following table summarises the three sets.
| Data set | Used to |
|---|---|
| Training set | Learn the model |
| Validation set | Tune hyperparameters and compare models |
| Test set | Give a final, unbiased check on unseen data |
Two phases of a model's life use these sets differently. Training is the phase in which the model learns from the training set and produces a model. Inference is the phase in which the finished model is used on new data to make predictions, which happens every time an application calls it.
Comparing results on the training set and the test set shows how well a model fits. A model that overfits has memorised its training examples, including their noise, instead of learning the general pattern: it scores very well on training data but poorly on new data. This is described as high variance, because the model's answers change a great deal with the particular examples it saw. A model that underfits is too simple to capture the pattern, so it scores poorly on both sets; this is described as high bias. The lesson Diagnosing Overfitting and Underfitting and Improving Models explains how each problem is fixed.
Training and inference
One company, four learning types
An insurance company has four projects. The deciding question for each is: what data is available, and does it contain the answer?
| Project | Data | Learning type |
|---|---|---|
| Predict whether a claim is fraudulent | Past claims, each marked fraud or not fraud | Supervised (classification): labels exist |
| Group customers into segments for marketing | Customer records with no segment labels | Unsupervised (clustering): no labels; the model finds groups |
| Teach a robot to sort paper forms | No data set; the robot is rewarded for correct sorting | Reinforcement learning: learns from rewards |
| Pre-train a language model on millions of policy documents | Raw text; the next word acts as the label | Self-supervised: labels come from the data itself |
The fraud project also illustrates overfitting. If the model scores 99% on the claims it was trained on but only 70% on next month's claims, it has memorised the training data rather than learned general patterns. The fix is more varied data, a simpler model or regularisation, and always judging the model on a held-back test set.
What kind of data does unsupervised learning use?
Show answer
Unlabelled data. The algorithm finds structure on its own, such as groups of similar customers, without being given the right answers.
Exam Tips
Remember for the exam
- Labelled data with known answers calls for supervised learning.
- With no labels, finding groups or outliers calls for unsupervised learning.
- Learning by trial, error and rewards is reinforcement learning.
- LLM pre-training, which predicts the next token, is self-supervised learning.
- An overfitted model performs very well on training data but poorly on new data (high variance).
- Hold back a test set to measure performance on unseen data.