Polynomial expansion serves to automate the creation of new features, to capture feature interaction, and to capture potential non-linear relationships between the original variables and the target. The user determines which features to combine and which polynomial degree to use.
The PolynomialFeatures() transformer from scikit-learn creates all polynomial combinations of the features with a degree less than or equal to the specified degree, automatically. To follow up easily with the recipe, let's first understand the output of the PolynomialFeatures() transformer from scikit-learn, when used with ...