Complete the code to import the class for creating polynomial features.
from sklearn.preprocessing import [1]
The PolynomialFeatures class is used to generate polynomial and interaction features from the original features.
Complete the code to create polynomial features of degree 3.
poly = PolynomialFeatures(degree=[1])Setting degree=3 creates polynomial features up to cubic terms.
Fix the error in the code to transform features using polynomial features.
X_poly = poly.[1](X)fit which does not transform data.transform without fitting first.The fit_transform method fits the transformer and applies the transformation in one step.
Fill both blanks to create polynomial features and exclude the bias term.
poly = PolynomialFeatures(degree=[1], include_bias=[2])
Degree 3 creates cubic features. Setting include_bias=False excludes the constant term.
Fill all three blanks to create polynomial features, transform data, and print the shape of the result.
poly = PolynomialFeatures(degree=[1], include_bias=[2]) X_poly = poly.[3](X)
transform without fitting first.Degree 2 creates quadratic features. Bias is excluded with False. fit_transform fits and transforms the data.