This repository contains the python implementation for Simple Linear Regression in two different ways:
- From scratch using NumPy
- Using Scikit-learn library
I have used employees salary data. This data have one feature named 'YearsExperience' and the output variable named as 'Salary'.
- We have to predict the salary of an employee based on the years of experience.
There are two notebooks with step-by-step implementation:
Simple_Linear_Regression_Using_Numpy.ipynb: Simple linear regression implemented with NumpySimple_Linear_Regression_Using_Scikit-Learn.ipynb: Simple linear regression implemented with Scikit-learn
model/Simple_LR_NumPy.py: Simple LR code implemented in Numpyutils/metrices.py: Python implementation for mean absolute error (MAE), mean squared error (MSE), and R-squaredutils/utils.py: Functions to save and load the model