Solution (source code)

= Solution

For $\eta(x)=\mathbb P(Y=1\mid X=x)$, the risk is
$$
R(\psi)=\mathbb P\{\psi(X)\ne Y\}.
$$
The <Bayes classifier> is $\psi^{\mathrm{Bayes}}(x)=\mathbf1_{\{\eta(x)\geq1/2\}}$, with risk $\mathbb E\min\{\eta(X),1-\eta(X)\}$.