Skip to content

RMalikM/Simple-Linear-Regression

Repository files navigation

Simple Linear Regression implementation in Python

This repository contains the python implementation for Simple Linear Regression in two different ways:

  1. From scratch using NumPy
  2. Using Scikit-learn library

Data

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.

Notebooks

There are two notebooks with step-by-step implementation:

  • Simple_Linear_Regression_Using_Numpy.ipynb : Simple linear regression implemented with Numpy
  • Simple_Linear_Regression_Using_Scikit-Learn.ipynb : Simple linear regression implemented with Scikit-learn

Additional .py files

  • model/Simple_LR_NumPy.py : Simple LR code implemented in Numpy
  • utils/metrices.py : Python implementation for mean absolute error (MAE), mean squared error (MSE), and R-squared
  • utils/utils.py : Functions to save and load the model

About

Simple Linear Regression implemented in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published