0

So rather than trying to find models, there is already a nonlinear polynomial regression model, for which I need to find the theta parameters.

= 12 + 2(1)^3 +3*(2)^4 + +

How would you go about estimating the parameters using least squares on a training dataset with four features x1-x4? I'm thinking forward subset selection, but I'm not sure how to implement this in Python.

Edit: If you already have the form of the model as shown above, do you still need to carry out subset selection in order to estimate model parameters? or can you just go ahead and use your training data in:

theta = (XTX)-1XTy

I gather forward subset is a model selection technique for when you don't already have a candidate model.

Thanks in advance.

Philly
  • 1
  • 1
  • A number of Python packages have polynomial regression including scikit-learn and statsmodels. – paisanco Feb 28 '21 at 16:38
  • Does this answer your question? [polynomial regression using python](https://stackoverflow.com/questions/31406975/polynomial-regression-using-python) – paisanco Feb 28 '21 at 16:39
  • Interesting question, but off topic here; try stats.stackexchange.com instead. Bear in mind that results from incremental variable selection are dependent on the order in which you try different variables; try all possible subsets (there are only 16) and see which combination is best according to an estimate of out of sample error such as cross validation error. – Robert Dodier Feb 28 '21 at 19:59

0 Answers0