Using a linear regression model that was coded from scratch, predicted the salary based on experience. The dataset has only one independant feature (years of experience) and one target (salary)
Workflow of Linear Regression
- Initialise learning rate, no of iterations, weights (numpy array) and bias (constant)
- Build Linear Regression equation (y = w * x + b)
- Find the predicted y value for each x value for the corresponding weight and bias
- Check the loss function for these parameter values
- Update the value for weight and bias using Gradient Descent
- Steps 3, 4, 5 are repeated till the value of the loss function becomes minimum
Here the scatter plot (red) represents the x_test vs y_test and the line plot represtents x_test vs y_predicted