liveBook · Manning

Squared error

As explained in Timeless Algorithms, The Foundational Ideas

Squared-error loss measures prediction error by squaring the difference between a predicted and observed value.

Squared loss assigns a prediction the squared difference between its predicted value and the observed value: (y − ŷ)². In regression, ordinary least squares sums these squared residuals to choose model coefficients. section 3.4.1 section 11.2.3

Squaring the discrepancy shapes what the fitting process treats as error:

  • It prevents positive and negative residuals from canceling, and gives larger residuals greater weight. section 3.4.1
  • With normally distributed errors, minimizing the sum of squared residuals gives the same regression coefficients as maximizing the likelihood. section 3.4.2
  • For neural-network regression, squared error measures prediction loss; backpropagation uses the loss gradient to guide parameter updates. section 11.2

Study hours and exam scores

A fitted line predicts a score of 7.85 for a student who studies seven hours. The observed score is 8.1, so the residual is 0.25 and its squared error is 0.0625. section 3.4.3

How Timeless Algorithms, The Foundational Ideas covers it

How deep it goes
Explains residual weighting and Gaussian-likelihood equivalence, then connects loss to neural-network training without detailing its derivatives.
Examples
Works through a study-hours and exam-score regression, including a predicted score and residual.
What you can do after
Understand how squared errors define regression fitting and provide a training signal for neural-network updates.
How it connects
Connects ordinary least squares with maximum likelihood estimation and backpropagation.

Also explained in

Compare how 5 books explain squared error →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Timeless Algorithms, The Foundational Ideas. The section links point to the parts of the book it draws on.