Machine LearningLesson 77Free preview
Polynomial Regression
This lesson is part of Python · All levels
Summary
Polynomial regression models curved relationships by adding the rank of variables such as x squared and x rank three as additional features. In scissor-learn, PolynomialFeatures convert one column X into a matrix containing its ranks that are then assigned to LinearRegression. The higher the degree, the more flexible the lines, but the risk of overfitting also increases. A degree of 2 or 3 is usually sufficient for a simple curved relationship.
Key points
- Polynomial regression deals with nonlinear relationships between variables
- PolynomialFeatures make derivative features such as x^2 and x^3
- High degrees make the line more flexible but prone to overfitting
- The transformation resulting features are trained with LinearRegression
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.