I've created 50 random x and y points (with slope of y = 2x-1).
First, I used Linear Regression from sklearn to fit the model onto my dataset where I got a slope of 2.0066...
and intercept of -0.535...
My Question: is fitting the model to our dataset considered training? For each given x value, since it has a y-value (supervised), does our machine go through each x,y match and create line of best fit based upon that? Thus, is our model trained?
Second, I used stats.linregress(x,y)
from scipy to get slope and intercept (which seem really close if not the same to the slope and intercept I've got from using sklearn Linear Regression).
My Question: If both methods give the same result, why not just use scipy to get formula for the best fit line to make predictions? What is the benefit of using machine learning?