Skip to content

Clement-W/Linear-Regression-SGD

Repository files navigation


Linear regression with Gradient Descent

example image

About The Project

To better understand the gradient descent algorithm, I've tried to implement it from scratch for a simple problem : linear regression.

I've implemented :

  • Classic GD
  • SGD
  • Mini-batch SGD

Prerequisites

  • Python ⩾ 3.8
    sudo apt install python3 python3-pip

Installation

  1. Clone the repo
    git clone https://github.com/Clement-W/Linear-Regression-SGD.git
    cd Linear-Regression-SGD/
  2. Create and activate a virtual environment
    pip3 install virtualenv --upgrade
    virtualenv venv
    source venv/bin/activate
  3. Install the requirements
    pip3 install -r requirements.txt

Demo

To see a demo, check the notebook file "LinearRegression_GD.ipynb". You'll find multiple examples of linear regression with classic gradient descent, stochastic gradient descent and mini batch stochastic gradient descent.

Contributing

I'm still learning machine learning, so feel free to use Issues or PR to report errors and/or propose additions or corrections to my code.

About

Implementation from scratch of the gradient descent algorithm for linear regression

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published