Our hypothesis function need not be linear (a straight line) if that does not fit the data well. We can change the behavior or curve of our hypothesis function by making it a quadratic, cubic or square root function (or any other form).
For example, if our hypothesis function is then we can create additional features based on , to get the quadratic function or the cubic function
In the cubic version, we have created new features and where and .
To make it a square root function, we could do:
One important thing to keep in mind is, if you choose your features this way then feature scaling becomes very important. Eg. if has range 1 - 1000 then range of becomes 1 - 1,000,000 and that of becomes 1 -