Loss is a quantification of how inaccurate a specific example’s prediction is from the actual data. For example: if a model predicts an example will have a value of 4.5, and it actually has a value of 4.2, the loss would be 0.3
Squared Loss
The most popular loss function is squared loss. That is:
or another way:
Mean squared error
Mean squared error (MSE) is the average squared loss per example. It can be calculated by dividing the sum of all squared losses by the number of examples. Eg:
In the above:
D: The data set
N: The number of examples in D
x: The set of features
y: The example’s label
y’: The predicted value of y. Eg: the (or ) of our linear regression formula