Linear models
We’ve already introduced, at a high level, the idea of OLS regression for a linear model. But this particular combination of squared loss for measuring the risk and a linear model for ˆ y has some very convenient and simple-to-use properties. This simplicity means that OLS regression is one of the most widely used and studied data science modeling techniques. That is why we are going to look in detail at fitting linear models to data using OLS regression.
To start with, we’ll revisit the squared-loss empirical risk function in Eq. 10 and look at what happens to it when we have a linear model ˆ y . To recap, the squared-loss empirical risk is given by the following:
Eq. 13
Now, for a linear model with features, , we can write the model as follows:
Eq. 14
The vector of model parameters is . We can write the features in vector form as well. We’ll write it as a row-vector, . Doing so...