liveBook · Manning

Ordinary least squares

Ordinary least squares is a regression parameter-estimation method that minimizes the sum of squared residuals between observed and predicted responses.

How 4 Manning books explain it

Geometry for Programmers

Least squares is a technique that chooses model parameters by minimizing the sum of squared discrepancies between predicted and observed values.

How it is used
Uses polynomial fitting to turn data points into interpretable curves and trends.
How deep it goes
Develops the error metric, generalized polynomial formulation, matrix construction, and SymPy solution, but defers elaborate derivations.
Examples
Uses rowing-time data, polynomial degrees from zero upward, plotted trends, and repeated endpoint observations.
What you can do after
Build it from scratch with Python and SymPy by assembling and solving the least-squares coefficient system.

Read how Geometry for Programmers explains ordinary least squares →

Effective Data Analysis

An ordinary least squares regression model estimates coefficients by minimizing the sum of squared differences between observed and predicted outcomes.

How it is used
Uses linear predictors to estimate outcomes and evaluate model behavior through coefficients, accuracy metrics, and residuals.
How deep it goes
Explains fitted equations, coefficient roles, predictive accuracy, residuals, and diagnostic plots without developing estimation internals.
Examples
Demonstrates housing-price prediction using square footage, bedrooms, fitted values, residual scatterplots, and residual histograms.
What you can do after
Apply it via statsmodels to fit a regression, generate predictions, inspect coefficients, and diagnose residual behavior.

Read how Effective Data Analysis explains ordinary least squares →

Ensemble Methods for Machine Learning

Ordinary least squares is a linear-model fitting method that minimizes the sum of squared residuals.

How it is used
Fits linear models for continuous-valued targets using squared loss without regularization.
How deep it goes
Defines the unregularized squared-loss objective and contrasts penalties, but does not derive the fitting solution.
Examples
Uses a noisy one-feature function, correlated features, scikit-learn estimators, held-out predictions, and MSE or MAD comparisons.
What you can do after
Apply OLS via scikit-learn, evaluate held-out predictions, and recognize when regularization may improve robustness.

Read how Ensemble Methods for Machine Learning explains ordinary least squares →

Grokking AI Algorithms, Second Edition

The least-squares method fits a model by minimizing the sum of squared differences between observed and predicted values.

How it is used
Fits a straight regression line to data points for estimating a dependent variable from an independent variable.
How deep it goes
Explains means, deviations, slope, intercept, and implementation steps, without pursuing theoretical proofs.
Examples
Uses carat-and-price data, scatter plots, a subway-route analogy, tabulated calculations, and Python-like pseudocode.
What you can do after
Builds a regression line manually or with a short function that returns its intercept, slope, and endpoints.

Read how Grokking AI Algorithms, Second Edition explains ordinary least squares →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.