AI engineering glossary · Classical ML algorithms
What is OLS (ordinary least squares)?
Ordinary least squares (also called OLS): The classic way to fit a line or plane: choose the weights that minimise the sum of squared differences between actual and predicted values. It has a closed-form solution when the feature matrix is well behaved, and it gives the best linear unbiased estimates under the Gauss-Markov assumptions.
Ordinary least squares: an example
With points (1,2), (2,3), (3,5), OLS gives the line y = 0.5 + 1.5x, which leaves smaller total squared error than any other straight line.
Related terms
More Classical ML algorithms terms
- Out-of-bag error
- Perceptron
- Permutation importance
- Polynomial kernel
- Polynomial regression
- Principal component
- Principal component analysis
- Quadratic discriminant analysis
Where you learn it
Ordinary 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.