Understanding Polynomial Regression. I understand that we use polynomial regression for some kind of non Linear Data set and to give it a curve. I know the equation of writing a Polynomial Regression for single independent variable but i don't really understand how this equation is constructed for 2 variables?

```y = a1 * x1 + a2 * x2 + a3 * x1*x2 + a4 * x1^2 + a5 * x2^2
```

What will be the equation for Polynomial Regression in case we have 3 or more variables? What actually is the logic behind developing these polynomial equation for more than one variable?

Mar 23, 2022 664 views

You can choose from the following options:

• Powers (thus x1, x12, x13, and so on) up to whichever number you like (many stop at 2).
• Cross products (x1 * x2, x1 * x3, etc.)
• Combinations (x12 * x2, x1 * x22, etc.) and then greater combinations (x1 * x2 * x3, and even powers) can be added.

However, this can soon grow out of hand, and you may wind up with an excessive number of features.
I'd stick to powers of two and cross products (just pairs) with no powers, similar to your example, and if you have three elements, then multiply all three of them, but if you have more than three, I wouldn't bother with triplets.
Polynomials are used to model the complex relationship between features, and they can sometimes be a decent approximation to more complex interactions (that are not really polynomial in their nature).

• 5,480 points

Is there a way to force the coefficient of the independent variable to be a positive coefficient in the linear regression model used in R?

A Few Constraints This is an example of ...READ MORE

Example of Logistic regression with python code

Have a look at this: import csv import ...READ MORE

On a given dataset would time taken to train n - random forest be equal to time taken to train n X (Decision tree)

No, the time to train the random ...READ MORE

+1 vote

What is the difference between correlation and covariance?

Correlation and Co-variance both are used as ...READ MORE

How do I become a data scientist step by step?

I am assuming that you are a ...READ MORE

What is the difference between random forest and decision trees?

The basic difference is that Random Forest ...READ MORE