Skip to content

Linear regression using gradient descent from scratch in C with GNUplot

License

Notifications You must be signed in to change notification settings

sanjeev309/linear_regression_using_GD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear Regression using Gradient Descent in C

A from scratch implementation of Linear Regression algorithm with 2 fitting parameters. The parameters are optimised using Gradient Descent algorithm. The implementation also utilises GNUplot to plot the data and cost over epochs.

Getting Started

  • Clone the repo into your folder

    git clone https://github.com/sanjeev309/linear_regression_using_GD

  • Experiment with values of EPOCH, LEARNING_RATE and default theta values in main.cpp

  • Execute make command to compile into an executable

    make compile

  • Run the executable

    ./linear_reg

  • Clean for a rebuild

    make clean

Prerequisites

*nix OS, gcc compiler, basic C programming and curiosity.

Breakout

Gradient Descent Algorithm for LR

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

  • This project dates back to 3+ years when I just began with Andrew Ng's ML course in MATLAB. A lot of gratitude for him and the initiative.

About

Linear regression using gradient descent from scratch in C with GNUplot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published