Under the hood — Linear Regression

towards-data-science

This post was originally published by Saurabh Singh at Towards Data Science

Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points, possibly subject to constraints.

Sample data with 5 rows

0. Starting out with a set of ’n’ variables

1. Assign random values to parameters and plot assumed curve

2. Using one instance of data calculate ŷ

3. Calculate loss

4 & 5. Calculate loss and update parameters

6. Repeat steps 2–5 with another instance of data

1. Assign random values to w1, w2 and b

2. Pick one instance from the data and calculate ŷ

3. Calculate the loss — How off was the calculated output from the actual output?

4. Calculate gradients

5. Update w1, w2 and b

Spread the word

This post was originally published by Saurabh Singh at Towards Data Science

Related posts