This project provides a visual simulation of the gradient descent algorithm for linear regression. It includes both Python and MATLAB implementations.
computeCost.m
: MATLAB function to compute the cost for linear regression.gradientDescent.m
: MATLAB function to perform gradient descent on the input data.testgradient.m
: MATLAB script to test the gradient descent function with some example data.testgradient2.m
: MATLAB script to visualize the cost function and the path of gradient descent.gradescent.py
: Python/Dash app to visualize the gradient descent algorithm.
Run the testgradient.m
or testgradient2.m
scripts in MATLAB.
Run the gradescent.py
script. This will start a Dash app that you can view in your web browser.
- MATLAB for the MATLAB scripts.
- Python 3 and the following Python libraries for the Python script:
- numpy
- dash
- plotly