Hello I am modeling a regression for my school project and one of the question I got from my professor was, how would I model this with polynomial regression. I have quite good random forest and knn regression models, however it is desired that I improve my polynomial regression model.

My question is, is polynomial regression any good for identifying multiple curves? Should I try to raise my polynomial regression degree, so its more "wobbly", or should I try to make 2 different models, as it is fairly easy to identify into which curve does the data point go?

I included a picture of the graph: Data points

  • 1
    $\begingroup$ The label suggests that there is another continuous variable. So you may want to consider a quadratic in two variables, including the interaction term. $\endgroup$ May 20 at 12:02
  • $\begingroup$ What you see in the label already is one of the variables (total of 8 attributes) time spent at ZPO, however it still doesnt fit very well $\endgroup$ May 20 at 12:38

1 Answer 1


As a comment suggests, you can certainly combine a polynomial fit for a continuous predictor along with its interactions with other predictors in your model. Those interactions could be with categorical predictors or other continuous predictors. As that comment also notes, it seems that you have already categorized another continuous predictor, ZPO. That's not a good idea in general. You will probably be better off keeping all your continuous predictors as continuous.

You probably don't want to go to a higher-degree polynomial that goes over the entire data range. This page both points out the limitations of such polynomial fits (particularly of high degree) and points out a better general solution: regression splines. A regression spline fits polynomials within several partitions of the range of data, while ensuring continuity and smoothness of the overall fit. Section 2.4 of Frank Harrell's Regression Modeling Strategies is one good introduction.

Regression splines are a particular type of "generalized additive model" (not to be confused with "generalized linear model" or "generalized least squares" or other "generalized" methods in statistics). Section 7.7 of An Introduction to Statistical Learning outlines the principles; earlier sections of Chapter 7 discuss different types of splines.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.