Lesson 5 of 12 9 min · 110 words
Expected vs. empirical risk
Average loss over the true distribution versus over the training sample.
The expected risk is the average loss over the true data distribution: . It is what we truly want to be small — but we cannot compute it because is unknown.
The empirical risk replaces the expectation with an average over the training sample: . By the law of large numbers, as for any fixed .
The catch: after we *choose* to make small, it is no longer a fair estimate of for that . This is precisely why training error underestimates test error, and why we need held-out data.
Formula to remember
Mini-batch gradient
Gradient estimated on a batch B; |B| = 1 is SGD.
Quick check · +5 XP