Introduction
So far we have mostly treated models as black boxes: call fit, call predict. This chapter opens the box for the simplest and most widely used model of all — linear regression — so you understand what it learns and how.
Understanding it pays off well beyond this one model:
- you'll be able to choose good hyperparameters and debug problems;
- the same ideas (weighted sums, cost functions, gradient descent) are the building blocks of logistic regression, SVMs and neural networks.
The everyday intuition: a taxi fare is roughly a fixed starting fee plus a price per kilometre. Linear regression learns exactly this kind of rule from data — a base value plus a weight for each feature.