Linear Regression using Gradient Descent
Linear Regression by implementing of gradient descent algorithm
The linear regression line is defined as $$y = \theta_0 + \theta_1 x $$
The parameters $\theta_0$ and $\theta_1$ can be computed using gradeint descent algorithm.
Gradeint descent algorithm is given as:
repeat until convergence { \begin{align} \theta1 &= \theta_1 - \alpha \frac{1}{m}\sum{i=1}^{m} \big ( h_\theta (x^{(i)}) - y^{(i)} \big ) x^{(i)} \ \theta0 &= \theta_0 - \alpha \frac{1}{m}\sum{i=1}^{m} \big ( h_\theta (x^{(i)}) - y^{(i)} \big ) \end{align*} }
Reference: https://towardsdatascience.com/
Step 1: Import libraries and dataset
Step 2 is skipped.