Polynomial feature interaction expands model inputs by raising features to powers or multiplying features together. It helps represent nonlinear relationships when a linear model leaves systematic prediction error. section 5.1.2
A practical workflow includes:
- Inspect residuals: patterns that are not white noise centered on zero suggest a missed transformation. section 5.1.2
- Add candidate transformations such as square, cube, square root, logarithm, or exponential, then retrain and compare test-set accuracy. section 5.1.2
- Add interaction terms by multiplying features when the important relationships are unknown, while watching for rapid dimensional growth. section 5.1.2
Quadratic relationship
Use sklearn.preprocessing.PolynomialFeatures to add squared inputs when you suspect a quadratic relationship, then test whether the expanded model reduces prediction error. section 5.1.2
