Rules nobody can write down
Spot the spam: one hand-written rule, or a learned one?
The headline
“Machine learning is the field of study that gives computers the ability to learn without being explicitly programmed” is the usual summary of Samuel’s idea. Instead of writing the rule, you collect data, describe it with features, and let a model learn the rule.
Walk one example through the whole process
Three ways a machine can learn
1 · Learn from answers
In supervised learning every example has a label. Give the learner more labelled fruits and watch its rule (red line) settle.
2 · Find groups without answers
In unsupervised learning nobody says who is who. k-means sorts 15 shoppers into k groups by how often and how much they buy.
3 · Learn from rewards
In reinforcement learning an agent acts and gets a reward: +10 at the goal, −1 per step. Arrows show what it currently thinks is best in each square.
The golden rule: judge on unseen data
Predict pass or fail from hours of revision
The rule. Learn from the training data, choose settings without peeking at the test data, and look at the test score once, at the end. A model that is too simple underfits; one that remembers every example overfits.
Nearest neighbour, by hand and by eye
Worked example by hand: three known fruits, one new one
For each known fruit: subtract the sizes, subtract the rednesses, square both differences (multiply each by itself, so minus signs disappear), add them, then take the square root. The smallest result is the nearest neighbour.
| rank | fruit | weight | redness | distance |
|---|
Where 70,000 examples add up
The arithmetic for that bar appears here.
Training vs test
Features per picture
Each pixel is one feature: a number from 0 (white) to 255 (black ink).
Four ways to learn, side by side
| kind | what it is given | feedback | typical question | beginner method |
|---|
Pick a row above.
Two families you will meet later. Self-supervised learning makes its own labels from raw data (hide a word, predict it) and is how large language models are pre-trained. Semi-supervised learning mixes a few labelled examples with many unlabelled ones.
The limit: the curse of dimensionality
What people do about it. Keep only features that matter (feature selection), squeeze many features into a few (dimensionality reduction), collect more data, or use models that look for simple structure. The name comes from Richard Bellman (1957).
Apply it to your own problem
Which kind of learning?
The seven steps · click or reveal
Lines in red change with your answers. You do not need to run the code to follow this page; it shows that the seven steps map onto a few lines.