Gradient
Lesson 5.7MathCode~50 min

Maximum likelihood

Why these losses? Pick the parameters that make your data most probable — and MSE and cross-entropy fall out.

Module 5 · 0/9 done

Turning the question around

So far we’ve asked: given a coin with a known bias, how likely are these flips? Machine learning asks the reverse. Given the flips we saw, which bias is the most believable?

The trick: for every possible bias pp, compute how likely the observed flips would be. That number, viewed as a function of pp, is the likelihood. Pick the pp where it peaks. That’s the maximum likelihood estimate.

L(p)=p#heads (1−p)#tailsL(p) = p^{\#\text{heads}}\,(1 - p)^{\#\text{tails}}
Fig 5.12Each bias p gives the flips some probability. Drag p to explore; the peak is the most likely bias. Add flips and watch the peak sharpen.