Code covered by the BSD License  

Highlights from
Linear Gradient Descent from lectures of Andrew Ng

Be the first to rate this file! 22 Downloads (last 30 days) File Size: 1.97 KB File ID: #40225
image thumbnail

Linear Gradient Descent from lectures of Andrew Ng

by Lukas Tencer

 

11 Feb 2013

This is an algorithm for fitting linear model to multivariate data.

| Watch this File

File Information
Description

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

MATLAB release MATLAB 8.0 (R2012b)
Tags for This File  
Everyone's Tags
gradient descent, linear models, mathematics, optimization
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us