The overfitting demonstration, the numbers behind it, and why this lesson is about judgement rather than curve fitting.
Click through linear, quadratic, cubic and have them call out the SSres each time. It falls every time, and they will start to believe the cubic is the answer. Let them.
Then ask what the coffee is doing an hour later. That is the moment the lesson turns, and it is far more effective than warning them about overfitting beforehand.
Every figure below was computed from the page's own data, not estimated.
| Model | SSres | At 60 minutes, room is 24 |
|---|---|---|
| Linear | 211.50 | −24.4, the coffee has frozen |
| Quadratic | 7.41 | +89.1, it has reheated to near its starting temperature |
| Cubic | 0.31 | −37.9, colder still |
| Exponential | 4.69 | 25.7, just above room temperature |
The cubic's 0.31 is worth pointing at. With fifteen data points it is very nearly threading every one, which is the curve memorising the measurement noise rather than learning the physics.
The point that makes the lesson. All three polynomials eventually run away, and they do it in different directions. A polynomial has no asymptote to settle onto, so none of them can ever describe something that approaches a limit and stops. No amount of fitting could have told you that. The physics chose the model and SSres only compared the candidates that were already sensible.
| Question | Answer |
|---|---|
| 1. Contribution to SSres | 7.84. 41.0 − 38.2 = 2.8, and 2.8² = 7.84. |
| 2. Cubic beats quadratic | B. More parameters always fit at least as well. |
| 3. Predicting at 60 minutes | B. The exponential, because cooling approaches room temperature. |
The worked example on the student page: observed 51.4, predicted 54.0, so the residual is −2.6 and it contributes 6.76.
| They enter | What it means |
|---|---|
| 2.8 (Q1) | They gave the residual rather than its square. Very common, and worth one sentence: the second S in SSres is for squared. |
| −2.8 (Q1) | Predicted minus observed. The convention is observed minus predicted, though the square is the same either way. Worth correcting now because the sign matters when they plot residuals. |
| "Too close to compare" (Q2) | They think it is a precision problem. It is not: even a tiny improvement is expected purely from the extra parameter. |
| "SSres cannot compare models" (Q2) | Over-corrected. It compares models with the same number of parameters perfectly well. Praise the caution, fix the scope. |
| "The cubic" (Q3) | The one that matters. They have followed the number. Send them back to the widget and ask where the cubic is at 60 minutes, which is minus 37.9 degrees. |
| "None, it is extrapolation" (Q3) | Good instinct from 4.4, slightly too strong here. A model justified by the physics can be used a little beyond the data if you declare it. Worth a short discussion of the difference between extrapolating a fitted line and extrapolating a mechanism. |
Computing SSres from a table is routine and marked on method: observed minus predicted, square, add. They keep marks through an arithmetic slip if the three steps are visible.
Justifying a model needs the context. "The exponential, because cooling tends towards room temperature" earns the mark. "The exponential, because SSres was smallest" often does not, because on this data it would have picked the cubic.
If they fit with technology, they should state which family they asked for and why. The calculator cannot know that a cooling curve needs an asymptote.
| What is happening | |
|---|---|
| 1 | Linear first. Let them see a line visibly failing on obviously curved data, which is also a callback to r only measuring linear association in 4.4. |
| 2 | Residuals and SSres, with the worked example done by hand once. |
| 3 | Click up through the polynomials, calling out SSres. Build the belief that smaller is better before breaking it. |
| 4 | The 60 minute question. This is the lesson. Give it room. |
| 5 | Questions 1 to 3, then the general principle: choose the family from the context, then use SSres to pick within it. |
Do not warn them about overfitting before they have watched SSres fall three times. The warning costs nothing to give and nothing is learned from it. The surprise is the teaching.
Do not say "the exponential is the best model" without saying why. On SSres alone it is not the best, it is third. If a student notices that and you have no answer ready, the lesson inverts.
Three tiers, ramping the way practice should: the method on its own, then the method inside something real, then a challenge. Set the tier the class in front of you needs rather than one undifferentiated sheet. Answers are given so these can go straight onto a board.
The method on its own, with friendly numbers. Set these first and move on quickly once they are secure.
The same skill inside a real situation, where the first job is working out what is being asked.
Reasoning, working backwards, or spotting an error. These are where the top grades are decided.
Works on a phone, though the curves past the data are easier to see on something larger. The library is served from this site rather than a public CDN, so it works behind a school firewall. Nothing a student types is saved or sent anywhere.