Data Science, Regression, Machine Learning, Polynomial Regression, Towards Data Science.
sklearn.preprocessing import PolynomialFeatures poly_features = PolynomialFeatures(degree=2, include_bias=False) X_poly = poly_features.fit_transform(X) print(X[0]) # O/P: array([-0.75275929]) print(X_poly[0]) # O/P: array([-0.75275929, 0.56664654]) We have imported PolynomialFeatures() from