When g {\displaystyle g} is a conditional probability distribution P ( y | x ) {\displaystyle P(y|x)} and the loss function is the negative log likelihood: L ( y , y ^ ) = − log ⁡ P ( y | x ) {\displaystyle L(y,{\hat {y}})=-\log P(y|x)} , then empirical risk minimization is equivalent to maximum likelihood estimation.