LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   General Discussion of Machine Learning (http://book.caltech.edu/bookforum/forumdisplay.php?f=105)

 Daniel 09-18-2012 11:59 PM

Polynomial regression

I'm curious about using polynomial regression with multiple features. I understand how to use polynomial hypotheses with univariate regression, but I'm unsure how to extend this to multiple features. Let's say I want to use a cubic polynomial. Do I introduce three terms in the hypothesis for each feature x^1 and x^2 and x^3 ?? So in effect, I'm tripling the number of features (or terms in the hypothesis equation)?

Thank you.

Daniel

 magdon 09-19-2012 05:49 PM

Re: Polynomial regression

You can certainly implement your suggestion, but it is technically not the 3rd order polynomial transform, although it is a form of polynomial transform. You would introduce every term that is at most 3rd order to get the full 3rd order polynomial transform. Here are those terms:    If you have variables and you want the -order polynomial transform, there are quick algorithms to generate these terms. As you can see, the number of terms rises very quickly. In this example you have done much worse than tripling. In general, for the -order polynomial transform with variables, the number of terms is Quote:
 Originally Posted by Daniel (Post 5567) I'm curious about using polynomial regression with multiple features. I understand how to use polynomial hypotheses with univariate regression, but I'm unsure how to extend this to multiple features. Let's say I want to use a cubic polynomial. Do I introduce three terms in the hypothesis for each feature x^1 and x^2 and x^3 ?? So in effect, I'm tripling the number of features (or terms in the hypothesis equation)? Thank you. Daniel

 Daniel 09-27-2012 10:00 PM

Re: Polynomial regression

Dear Dr. Magdon,

Thank you so much for the informative reply. Of course, your solution makes perfect sense. It just wasn't obvious to me. I shall experiment with this.

Cheers,

Daniel

 All times are GMT -7. The time now is 12:55 PM.