Phase 1: Prepare
Step 1 Warm-up recall
From Module 2: what is the baseline for predicting a number?
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- say what slope and intercept mean (Foundation);
- predict from a given line (Foundation);
- explain the slope in words for a real situation (Core).
Phase 2: Teach
Step 3 A familiar example
A taxi charges a fixed fee and then a price for each kilometre. Knowing those two numbers lets you quote any journey. A regression line works in exactly the same way.
Step 4 Clear explanation
The simplest model for predicting a number y from a number x is a straight line: y = a + bx. The number a is the intercept, the predicted y when x is 0. The number b is the slope, how much the prediction changes for each one-unit increase in x.
Take a taxi fare of 3 + 2x pounds, where x is the distance in kilometres. The intercept 3 is the fixed fee and the slope 2 is the price per kilometre.
| Distance x (km) | Fare y = 3 + 2x (£) |
|---|---|
| 0 | 3 |
| 1 | 5 |
| 2 | 7 |
| 6 | 15 |
For 6 km the prediction is 3 + 2 × 6 = 15 pounds. The slope is the useful sentence to say aloud: each extra kilometre adds about two pounds. A negative slope means y falls as x rises, as with the price of a used car against its age.
In machine learning this line is a model. The two numbers a and b are its parameters, and fitting the model means choosing them from data, which is the subject of the next lesson.
Step 5 Worked example (4 marks)
A model is y = 10 + 4x, where x is hours of training and y is units sorted per hour. Predict y for x = 3 and explain the slope.
- Substitute: 10 + 4 × 3. (1 mark)
- Calculate: 10 + 12 = 22. (1 mark)
- The slope is 4. (1 mark)
- Answer: 22 units per hour; each extra hour of training adds about 4 units per hour. (1 mark)
Go deeper: the professor's notes
Start.
Per unit.
a + bx.
Fare
| Distance (km) | Fare (£) |
|---|---|
| 0 | 3 |
| 2 | 7 |
| 6 | 15 |
At work: Taxi fare
The fare is 3 + 2x pounds.
- Read the intercept as the fixed fee.
- Read the slope as pounds per kilometre.
What a careful practitioner decides. Say the slope in words with its units.
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. In y = a + bx the intercept is:
The value of y when x is 0.
2. The slope tells you:
Change in y per unit of x.
3. For y = 3 + 2x, x = 5 gives:
3 + 10.
4. A negative slope means:
The line slopes downward.
Phase 4: Close
Step 7 Recap
- A line model is y = a + bx.
- The intercept is the prediction at x = 0; the slope is the change per unit of x.
- Fitting means choosing a and b from data.
Step 8 Exit ticket (ungraded)
For y = 5 + 3x, predict y when x = 4 and say what the slope means.
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Find a relationship in your own work that is roughly a line and say what its slope would mean.
In industry: Anscombe: four data sets, one line
In 1973 the statistician Francis Anscombe built four small data sets of eleven points each. All four give the same fitted line, y = 3.00 + 0.500x, and the same R squared of 0.67, yet they look completely different when plotted.
Link to this lesson. The numbers from a fit cannot say whether a line is the right shape, so plot the data first.
Source: Anscombe (1973), Graphs in Statistical Analysis, The American Statistician 27(1); Anscombe quartet, Wikipedia
Common mistakes
| Mistake | Why it fails |
|---|---|
| Swapping slope and intercept | The intercept is where the line starts; the slope is how steeply it rises. |
| Giving the slope without units | Say “pounds per kilometre”, not just 2. |
| Reading the slope as cause | It shows association in the data, not necessarily cause. |
Limits. Straight lines are the simplest case; curves and several features come later.