Machine Learning - Supervised Learning - Polynomial Linear Regression [Regression] Tutorial
Hyperparameter – degree, include_bias
If data is not linear, then polynomial LR will work
Polynomial Regression is a regression algorithm that models the relationship between a dependent(y) and independent variable(x) as nth degree polynomial. The Polynomial Regression equation is given below
y= b0+b1x1+ b2x12+ b3x13+...... bnx1n
if in dataset, data points are arranged in a non-linear fashion, we need the Polynomial Regression model
Why polynomial linear regression called linear regression, though the model is not linear?
Polynomial regression is a form of Linear regression where only due to the Non-linear relationship between dependent and independent variables we add some polynomial terms to linear regression to convert it into Polynomial regression.
Practically, we transform dataset using PolynomialFeature, an then pass it to LinearRegression
If degree is 2,and 1 input variable then equation is y= b0+b1x1+ b2x12
If higher value of degree, this model will overfit. If less value of degree, this model will underfit. So, optimal value is required.
Multiple polynomial regression
If degree is 2,and 2 input variable then equation is y= b0 + b1x1 + b2x12 + b3x2+ b4x22
If degree is 3,and 2 input variable then equation is y= b0 + b1x1 + b2x12 + b3x13+ b4x2 + b5x22 + b6x23