Linear regression is a linear system and the coefficients can be calculated analytically using linear algebra. ... Linear regression does provide a useful exercise for learning stochastic gradient descent which is an important algorithm used for minimizing cost functions by machine learning algorithms.