Sum of Squared Errors (SSE) › Mathematical Foundation
Machine Learning from ScratchAll chapters Sum of Squared Errors (SSE) › Mathematical FoundationOne section · Sections in this chapter3 / 10 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The SSE Formula
The Sum of Squared Errors is defined as:
Where:
- : The actual (observed) value for the -th observation
- : The predicted value for the -th observation from our model
- : The total number of observations
- The summation runs over all data points
Key Components
Residuals: The difference is called a residual - it represents how far off our prediction is from the actual value. A residual can be positive (prediction too low) or negative (prediction too high).
Squaring: We square each residual to:
- Eliminate the sign (make all differences positive)
- Penalize larger errors more heavily (squared errors grow quadratically)
- Ensure the metric is always non-negative
Summation: Adding up all squared residuals gives us the total error across all observations.
Alternative Notations
SSE is also known by several other names in different contexts, which can sometimes lead to confusion when reading different textbooks or research papers. While the underlying calculation remains the same, the terminology may shift depending on the field or the author's preference. Here are some of the most common alternative names for SSE:
- Sum of Squared Residuals (SSR): Emphasizes that we're measuring residuals
- Residual Sum of Squares (RSS): Another common notation
- Error Sum of Squares: Focuses on the error component
All refer to the same mathematical concept: