# Derive main prediction for zero-one loss function

Intuitively I can see why mode of predictions is the main prediction of a zero-one loss function, but mathematically I am not sure how it is derived?

Main prediction $$= argmin_{y'}E_D[L(\widehat y, y')] \\$$

L_z(y,\widehat y) = \begin{align*} &\ \Big\{ \begin{aligned} 0 \quad if \quad \widehat y = y \\ 1 \quad otherwise \\ \end{aligned} \end{align*}