Interactive classroom companion · Darren Broemmer · Lake-Sumter State College
The model starts with one guess: the population average height of 175 cm. Each "step" it sees a new batch of people, measures its error, and nudges its prediction. Change the learning rate and batch size to see how training behavior changes.
The same dataset used throughout the lecture (N = 80 representative records). Use these charts to answer: which features most predict insurance charges? What does "correlation" look like visually?
A categorical feature can be the most powerful predictor. The gap here is dramatic.
Both metrics measure how wrong our predictions are — but they penalize errors very differently. Use the slider to introduce an outlier and watch what happens to each metric.
Each error counts by its absolute size. A 10 cm error is exactly 5× as bad as a 2 cm error. All errors get a proportional vote, so large outliers don't dominate.
Each error is squared before averaging. A 10 cm error contributes 100 — but a 2 cm error only contributes 4. Large errors get disproportionately more weight.
Five predictions are made. Four have small, realistic errors. The fifth is the outlier. Slide it from a small error (1 cm) to a large one (20 cm) and watch how MAE and MSE respond.
| Prediction | Error (eᵢ) | |eᵢ| (MAE contrib.) | eᵢ² (MSE contrib.) |
|---|
The key insight: MSE penalization grows with the error itself. A 10 cm error gets penalized 10× more harshly by MSE than MAE does — not just 10× but 10× as if every cm were also multiplied by the error size.
| Error size | MAE contribution | MSE contribution | MSE ÷ MAE |
|---|---|---|---|
| 1 cm | 1 | 1 | 1× |
| 2 cm | 2 | 4 | 2× |
| 5 cm | 5 | 25 | 5× |
| 10 cm | 10 | 100 | 10× |
| 15 cm | 15 | 225 | 15× |
| 20 cm | 20 | 400 | 20× |
ML models detect correlations — not causes. That distinction matters enormously in production.
Slide the controls to change the dataset. Watch the correlation coefficient change.