The problem of fitting a polynomial curve to the data is called polynomial regression, or better “linear regression with polynomial features”, since the problem is still the same of linear regression, but we have a polynomial function.
Note that the polynomial function is polynomial with respect to the data, but is still linear in the parameters.
In matrix notation we can express the function as:
The solution is the same as the linear regression solution, with the requirements that .
In the matrix we have a row for each data point, and a column for each parameter.
Is polynomial regression all we need?
Since we can approximate every continuous function with a polynomial, as stated by The Stone-Weierstrass theorem, is polynomial regression all we need in order to fit the data?
The answer to this question is NO, since polynomial regression is kind of limited, and we cannot perform some useful thing with it, for example:
- If we want different loss functions than MSE;
- If we want to apply regularization;
- If we have additional priors;
- If we want to compute intermediate features;
- If we want more flexibility;
- If we want to perform classification instead of regression.