Loss function

Applies to: python, general

A loss function measures how wrong a model's prediction is. Training tries to reduce the average loss.

loss = ((y - y_hat) ** 2).mean()

See also: gradient, mean-squared-error, cross-entropy