Data Science, Regression, Machine Learning, Polynomial Regression, Towards Data Science.
sklearn.preprocessing and then initialized an object poly_features. After that, we simply call fit_transform and pass our dataset as a parameter. X_poly now contains the original feature of X plus the square of this feature. Now you can fit a LinearRegression model to this extended training data.