Gradient Descent for Linear Regression
Let’s use what we learned about…
To train a linear regression model to fit a straight line through our training data.
The derivatives in the gradient descent algo can also be written like this:

The first is the derivative in respect to w, the second is the derivative in respect to b. These formulas are derived using calculus. Understanding how this derivation works is completely optional, and can be found below
Optional Calculus Derivation
One of the nice things about implementing gradient descent over a squared error cost function is that the function is a convex function, meaning it has a single global minimum




