SquareLoss

class getml.models.loss_functions.SquareLoss

Bases: getml.models.loss_functions._LossFunction

Square loss (aka mean squared error (MSE))

Measures the loss by calculating the average of all squared deviations of the predictions \hat{y} from the observed (given) outcomes y. Depending on the context this measure is also known as mean squared error (MSE) or mean squared deviation (MSD). deviation (MSD).

L(y,\hat{y}) = \frac{1}{n} \sum_{i=1}^{n} (y_i -\hat{y}_i)^2

with n being the number of samples, y the observed outcome, and \hat{y} the estimate.

Note

Recommended loss function for regression problems.