Using non-linear regression
Linear regression assumes that the relationship of a feature to the target is constant across the range of the feature. You may recall that the simple linear regression equation that we discussed at the beginning of this chapter had one slope estimate for each feature:
Here, y is the target, each x is a feature, and each β is a coefficient (or the intercept). If the true relationships between features and targets are nonlinear, our model will likely perform poorly.
Fortunately, we can still make good use of OLS when we cannot assume a linear relationship between the features and the target. We can use the same linear regression algorithm that we used in the previous section, but with a polynomial transformation of the features. This is referred to as polynomial regression.
We add a power to the feature to run a polynomial regression. This gives us the following equation:
The following plot...