Skip to content

Zaroymi/linear-regression-gd

Repository files navigation

Linear Regression Gradient descent

There is an example of simple gradient descent algorithm for the linear regression task

Dependencies

  • Python ~ 3.7.6
  • pandas
  • numpy
  • matplotlib
  • sklearn
  • jupyter (if you want use jupyter notebook)

What you can do with this repository?

  1. Learn how to make an GD algorithm in python and use it on real dataset
  2. Find an example of sklearn Linear Regression

How to use this

Jupyter notebook

  1. Install packages from the list above
  2. Open linear_regression_algo.ipynb in jupiter notebook

OR

Python

  1. Install packages from the list above
  2. Run linear_regression_algo.py
  3. It reads data from dataset folder home_data.csv. You can change behaviour in datasets.py
  4. Аfter completion of the algorithm you will see all epoch on plots

Example dataset

The data set for an example is taken from here.

Output

Imgur