Data Science, Regression, Machine Learning, Polynomial Regression, Towards Data Science.
lin_reg = LinearRegression() lin_reg.fit(X_poly, y) print(lin_reg.intercept_, lin_reg.coef_) # o/p: (array([1.78134581]), array([[0.93366893, 0.56456263]])) Best fit line Not bad: the model estimates y = 0 . 56 x₁² + 0 . 93x₁ + 1 . 78 when in fact the original function was y = 0 . 5 x₁² + 1 . 0x₁ +