AI engineering glossary · Linear algebra

What is least squares?

Least squares (also called Ordinary least squares): A method for finding the vector x that makes A x as close as possible to b by minimising the sum of squared differences, used when a system has more equations than unknowns. It is the mathematical core of linear regression.

Level: intermediateTopic: Linear algebra

Least squares: an example

Fitting a line through 50 noisy points means finding the slope and intercept that minimise the total squared vertical gaps.

Related terms

More Linear algebra terms

Where you learn it

Least squares is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.