In this repository we will see the basic different in ols(Ordinary Least Squares) method sdg(Stochastic Gradient Descent) method for a simple linear regression. Generally in simple linear regression only one indepent variable(x) will Determine the dependent variable(y) in which we have 2 methods to predict/make the best fit line to the regression that is Ordinary Least Squares and the other one is Stochastic Gradient Descent. with this method's we will draw a good/best fit line to the dataset and find out which method is the best.
To run the code follow the below steps:
1.Install python(3.6+) and need packages.
pip install numpy
pip instll pandas
pip install matplotlib
pip install -U scikit-learn
2.Clone this repository .
https://github.com/karthikeyanthanigai/Simple-linear-regression-ols-vs-sgd-
3.Open command line and set the directory to the cloned repository.
cd Simple-linear-regression-ols-vs-sgd-
4.Enter the command.
python simple_linear_reg.py
if you got any error in install the packages then refer Stackoverflow.