At a glance
- Machine learning means learning from data so that you do well on data you have not seen. That property is called generalization.
- It is not a hand-written procedure, not memorization and not magic. It is algorithms plus data, built on mathematics.
- The three paradigms differ in what the learner is given: labelled data (supervised), unlabelled data (unsupervised), or feedback one decision at a time (sequential).
- The course covers classification, regression, clustering and representation learning. Ranking, structured learning and all of sequential learning are only mentioned.
- Every algorithm needs a structure (linear algebra), a way to handle noise (probability) and a way to pick the best answer (optimization).
Why study machine learning
The first reason is reach. A Forbes list of the top ten digital transformation trends, from a couple of years before the lecture, included analytics, AI and machine learning, conversational AI and autonomous drones. Each of these depends on machine learning in one way or another.
The second is popularity. On Google Trends, searches for machine learning, deep learning and artificial intelligence all took off from about 2016. "Artificial intelligence" was the common search in the early 2000s, faded as machine learning took over, and has recently picked up again with newer ideas such as causality.
Deep learning is a subset of machine learning. The BS programme covers it in a separate elective.
Where machine learning is used
One way to find applications: list what comes naturally to people, then ask how a machine could do the same.
Seeing → computer vision
The eye and brain evolved over millions of years. Getting a computer to say "this picture contains a tree" is object recognition.
Hearing speech → language understanding
Speech is unstructured. Different people say the same thing in different ways, and we still understand them.
Reading → text understanding
Millions of unstructured documents appear every day. Tasks range from understanding meaning to reading handwriting.
Thinking → how the brain learns
The holy grail: understanding, computationally, how interconnected neurons learn and decide. Progress comes in small steps.
Beyond the senses, anything that produces a lot of data can be learned from:
- Finance. Will a stock go up, given how it has done over time?
- Science and engineering. Biology, chemistry and materials experiments.
- Sports analytics. Who wins the next IPL match, Chennai or Bangalore? (The lecturer is a Chennai fan.)
- E-commerce. "People similar to you bought this", picked to maximize the chance you buy it.
Rule of thumb: wherever there is a lot of data, there is probably a machine learning problem.
What machine learning is, and what it is not
The lecture defines ML by contrast. Each misconception has a matching answer.
| It is not | It is | Lecture example |
|---|---|---|
| A procedure. Input runs through fixed steps to an output, and nothing is learnt. | Algorithms plus data. Data is the "secret sauce": the algorithm learns from it, then predicts on test data. | A tax calculator applies fixed rules to your salary and savings. No learning happens. |
| Memorization. | Generalization. Doing well on unseen data, which only works if the concept was actually learnt. | 1,000 photos with trees and 1,000 without. Memorizing all 2,000 answers tells you nothing about a new photo. |
| Magic. | Mathematics. | The prerequisites (below) are the maths behind every algorithm. |
The lecture's exam analogy makes the second row concrete. If the final exam only repeated the assignment problems, memorizing every step would score full marks without learning the subject. ML is always graded on the unseen exam.
L1 closes with eight example problems: spam filtering, rainfall forecasting, movie recommendations, friend suggestions, voice/instrument separation, photo grouping, robot navigation and stock prediction. L2 sorts them into paradigms; they are collected in one table below.
Three paradigms
The paradigms are told apart by what the learner is given.
- Supervised learning. Data plus supervision. A teacher or labeler marks emails as spam or not spam, and the job is to learn to tell the labels apart.
- Unsupervised learning. Only data. You are asked to make sense of it, for example by grouping it automatically.
- Sequential learning. You do not learn in one shot. You make a decision, receive feedback (a form of supervision), update your model, and repeat. This is not covered in the course.
Unsupervised problems need a notion of similarity
Hand someone a pile of animal photos with no labels and the task is not yet well posed. The photos could be grouped as animal vs background, dogs vs cats, four animals vs six, or white vs brown fur. Each is a different notion of similarity. Fix one, say cats vs dogs, and the groups follow: only cats, only dogs, and both.
The sub-types L2 · 4:16
- Classification: labels come from a finite set. Spam vs non-spam is binary (2 labels). Recognizing the digits 0–9 has 10 labels: still finite, just not binary.
- Regression: the output is a continuous number.
- Ranking: order a set of objects instead of predicting one label each.
- Structured learning: the labels themselves have structure, for example trees.
- Clustering: grouping objects, as in the animal photos.
- Representation learning: how to represent each data point so a task becomes easier. An image stored as raw pixel values may not be the best form for spotting a tree. It can be done with or without supervision; this course does the unsupervised kind, starting in L3.
Sequential learning, briefly
Not examined in this course, but worth knowing. The three settings differ in how much feedback each decision returns.
- Online learning (full information). You take stock advice from a group of experts and decide whether to invest. In the evening you see whether the stock went up. That outcome scores every expert's advice, not just your decision.
- Multi-armed bandits (partial feedback). An algorithm suggests one of four treatments for a patient. A week later you know whether that patient improved, but not what the other three treatments would have done. You see less, so the problem is harder.
- Reinforcement learning. A robot must cross a room with obstacles. At each location (the state) it picks front, left, right or back (the action). The mapping from states to actions is a policy, learned from the environment's feedback by trial and error. Moving forward is not always wrong; it depends on where the robot is.
Eight problems, sorted by paradigm
L1 lists these problems and L2 places each one. Hide the answers and try to classify them first.
| Problem | What you have | Paradigm |
|---|---|---|
| 1Spam filter | Emails already labelled spam or not spam | Supervised · binary classificationtwo possible labels |
| 2Rainfall forecast | 10–15 years of daily pressure, humidity, precipitation and rainfall | Supervised · regressionrain is a continuous amount, like 2.23 cm |
| 3Movie recommendations | What you have watched; about five slots on the home screen | Ranking / ordinal classificationorder matters: the right film in 100th place is useless |
| 4Friend suggestions | A network of people and their existing connections | Link predictionwill a missing edge in the network form? |
| 5Voice / instrument separation | Songs (MP3s) where the voice and instruments overlap | Unsupervisedlabelling every second is tedious, and often both play at once |
| 6Grouping photos on a phone | Untagged photos from different angles, places and times of day | Unsupervised · clusteringit knows the faces match, not whose they are |
| 7Robot navigation | Feedback after every move it makes | Sequential · reinforcement learninglearns a policy by trial and error |
| 8Stock prediction | Predict each morning, see the result each evening, for you and your advisers | Sequential · online learningfull feedback on every adviser, every day |
Why the maths: one example
The prerequisites are those of the ML Foundations course: linear algebra, probability, statistics, high-school calculus and a little optimization. The lectures try to stay self-contained, so knowing that material is enough even without MLF.
The example: record the weight and height of 100 people and plot them. Can you predict someone's height from their weight alone? On average height rises with weight, roughly in a straight line, so look for the best line. But there are infinitely many lines, even if you only allow lines through the origin, and none of the points sit exactly on the best one. You need a criterion for "best". Try it:
Three ingredients, three subjects L2 · 21:37
Linear algebra
Assume weight and height are linearly related, so search over lines. Linear structure comes first; non-linear structure is built on it later in the course.
Probability
Points miss the line because of noise: how the data was collected, faulty equipment, missing values. Probability is the language for that uncertainty.
Optimization
Pick the line that does best by some measure, which means maximizing or minimizing something. That is how data becomes a decision.
What the course aims for
- A clear high-level picture of the paradigms, then the detail through specific algorithms.
- Given a real-world problem, pose it as an ML problem (supervised? unsupervised?) and choose algorithms that suit it.
- Know the key algorithms: how they differ, when and why each works, and their pros and cons.
- A solid theoretical and statistical base, so algorithms are understood from the inside rather than as black boxes.
- Implement the algorithms from scratch and show results with graphs and plots. Non-graded assignments and the discussion forum are there for this.
Roadmap and references
The course starts with unsupervised learning, then moves to supervised learning, with assignments along the way to check where you stand.
References L2 · 24:18
No single textbook is followed. The lecture notes are enough for assignments and exams; these are for going deeper.
- Pattern Recognition and Machine Learning (PRML)Christopher M. BishopThe main reference. Notation and order differ from the lectures, but every topic taught has a matching section, and the book covers a superset. One edition is freely available.
- Mathematics for Machine LearningDeisenroth, Faisal and OngPuts the foundations maths into an ML context. Free from the authors.
- Linear Algebra and Its ApplicationsGilbert StrangFor brushing up linear algebra.
- A First Course in ProbabilitySheldon RossFor probability.
Key terms
- Generalization
- Doing well on data the algorithm has never seen. The goal of ML, as opposed to memorization.
- Supervised learning
- Learning from data that comes with labels supplied by a teacher or labeler.
- Unsupervised learning
- Finding structure (groups, representations) in data without labels.
- Sequential learning
- Learning step by step from feedback on your own decisions.
- Classification
- Predicting a label from a finite set. Binary when there are two labels.
- Regression
- Predicting a continuous number.
- Representation learning
- Finding a better description of each data point so a task becomes easier.
- Full-information feedback
- After each round you learn how every option would have done (online learning).
- Partial feedback
- You learn the result only for the option you chose (multi-armed bandits).
- Policy
- A mapping from states to actions, learned in reinforcement learning.
- Link prediction
- Predicting which missing edges in a network are likely to exist.
- Ordinal classification
- Predicting items and also the order they should appear in, as in recommendations.
Test yourself
Q1A spam filter and a rainfall forecaster are both supervised. What separates them?
The type of label. Spam or not spam is a finite set, so it is binary classification. Rainfall in centimetres is continuous, so it is regression.
Q2Why doesn't memorizing the training data count as learning?
It can only answer for inputs it has already seen. ML is judged on unseen data, and doing well there (generalization) requires learning the underlying concept.
Q3Your phone groups photos by person but asks you to type the names. Which paradigm is this, and why does it have to ask?
Unsupervised clustering. It was given no labels, so it can tell that faces are similar to each other but not who they belong to.
Q4Why is choosing a treatment "partial feedback" while following stock experts is "full information"?
With treatments you only observe the outcome of the one you gave. With experts, the day's market move scores every expert's advice, including the ones you ignored.
Q5In the height–weight example, which subject handles each step: assuming a line, points that miss the line, choosing the best line?
Linear algebra (structure), probability (uncertainty), optimization (decision).
Q6Movie recommendation is more than predicting "will they like it". What extra requirement makes it a ranking problem?
Order. There are only about five slots on screen, so the right movies must appear in the right order. A good movie found but placed 100th is not useful.