Linear regression (SkLearn Regression)

x1 = X
x2 = X**2

X = np.stack((x1,x2),axis=1)

why did we use the above code in the repository

nakul it is to get polynomial features in our model.as u can see linear features would have predicted best line to fit the curve but that line would underfit our data. so the better model would be one with parabolic features so by adding x square column we are introducing polynomial features to our model so that we can find a parabola which fits our model best and as u can see parabola is a good fit to our data.

We created two features from single feature.
First feature - x
Second feature - x**2

Linear model treats them as two different features and genrates a quadratic boundary.