June 9, 2020
Scikit-Learn
We don’t need to build a linear regression algorithm from scratch.
We can use Python’s Sci-Kit Learn library when we want to perform linear regression.
Scikit-Learn = sklearn is specifically used for machine learning.
Inside the linear_model module, there is a LinearRegression( ) function we can use:
from sklearn.linear_model import LinearRegression
LINEAR REGRESSION REVIEW
We can measure how well a line fits by measuring loss.
The goal of linear regression is to minimize loss.
To find the line of best fit, we try to find the b value (intercept) and the m value (slope) that minimizes loss.
Convergence refers to when the parameters stop changing with each iteration.
Learning Rate refers to how much the parameters are changed on each iteration.
We can use Scikit-Learn’s LinearRegression( ) model to perform linear regression on a set of points.