1. Supervised learning ▶ Watch
The model learns from labelled examples - inputs paired with the correct answers. It is like a student studying with an answer key. Two main tasks:
- Classification - predict a category: spam or not spam, cat or dog, fraud or genuine.
- Regression - predict a number: house price, temperature tomorrow, delivery time.
2. Unsupervised learning ▶ Watch
The model receives data without labels and must find structure by itself. Common tasks are clustering (grouping similar customers), anomaly detection (spotting an unusual bank transaction) and dimensionality reduction (compressing many features into a few for visualisation).
3. Reinforcement learning ▶ Watch
An agent takes actions in an environment and receives rewards or penalties. Over many attempts it learns a strategy that maximises reward. This is how AlphaGo mastered Go and how robots learn to walk in simulation. A variant, reinforcement learning from human feedback (RLHF), is used to make chat assistants more helpful and safe.
Other important learning methods ▶ Watch
- Self-supervised learning - the data creates its own labels. An LLM hides the next word and learns to predict it. This lets models learn from huge amounts of unlabelled text.
- Semi-supervised learning - a small amount of labelled data plus a large amount of unlabelled data.
- Transfer learning - start from a model already trained on a big task, then adapt it to a smaller, related task.
- Fine-tuning - further training a pre-trained model on specific data, such as medical notes or a company's support tickets.
- Federated learning - training across many devices (such as phones) without collecting everyone's raw data in one place.
Common machine learning algorithms ▶ Watch
| Algorithm | Type | Typical use |
|---|---|---|
| Linear regression | Supervised (regression) | Predicting prices or sales |
| Logistic regression | Supervised (classification) | Yes/no predictions such as churn |
| Decision tree | Supervised | Easy-to-explain decisions |
| Random forest | Supervised | Robust predictions from many trees |
| Gradient boosting | Supervised | Top results on table data |
| Support vector machine | Supervised | Text and image classification |
| k-nearest neighbours | Supervised | Simple recommendation and similarity |
| Naive Bayes | Supervised | Fast spam filtering |
| k-means | Unsupervised | Customer segmentation |
| Neural networks | Any | Images, speech, language, generation |
Chapter summary
- Supervised learning uses labelled examples; unsupervised learning finds hidden structure; reinforcement learning learns from rewards.
- Self-supervised learning lets LLMs learn from vast unlabelled text.
- Transfer learning and fine-tuning adapt big pre-trained models to specific jobs.
- Classic algorithms such as decision trees remain very useful, especially for table data.