Squared error is the square of the difference between a predicted value and the true value. Where:

  • is the true value
  • is the predicted value

Definition

It measures how far of a prediction is, but by squaring the difference:

  • Makes all errors positive
  • Penalizes larger errors more heavily

Example

If the true value is 10 and the prediction is 7: So the squared error = 9

It is the basic building block of Mean Squared Error (MSE), where you average squared errors over many predictions.