Linear Gradient Descent from lectures of Andrew Ng
function [ args ] = geadientDescent( data )
where the lines of the matrix are datapoints and columns are dimensions, last dimension is one to be infered. It is implemented according to lectures of Andrew Ng.
You can set learning rate, normalization and stop criterion, edit the file.
default values are:
learning rate: 0.2
stop criterion: 0.0000001
normalization: yes
Also small dataset and script to load the dataset is present, also at the end of the file, there is commented out code to visualize 2D version of the algorithm.
If you wish to see the algorithm perform, do the following:
1. Unpack
2. x=loadData('2Dset')
3. gradientDescent(x)
enjoy!
It is free for any use. If you use it, please cite: http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6310525
Cite As
Lukas Tencer (2024). Linear Gradient Descent from lectures of Andrew Ng (https://www.mathworks.com/matlabcentral/fileexchange/40225-linear-gradient-descent-from-lectures-of-andrew-ng), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: Gradient Descent for Linear Curve Fitting, Linear Regression Machine learning
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |