aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 4. Learning as an Optimization Problem
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

Minimising J(w) = (w − 3)² from w = 0 with η = 0.1, the first step gives w = …

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser