Mean squared error

Applies to: python, general

Mean squared error averages squared prediction errors. It penalizes large errors strongly.

mse = np.mean((y - y_hat) ** 2)

See also: loss-function, linear-regression