From ebf81a4ac12e6aa8b638858e78c7bec24dd70eea Mon Sep 17 00:00:00 2001 From: Sam Perry Date: Thu, 3 Nov 2016 14:36:51 +0000 Subject: [PATCH] Added comments to mllab2 --- mllab2.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mllab2.m b/mllab2.m index 94f5de4..7e91334 100644 --- a/mllab2.m +++ b/mllab2.m @@ -10,10 +10,13 @@ X = [ones(size(X, 1), 1), X]; %initialise theta theta = [0.0, 0.0, 0.0]; +% Learning rate alpha = 0.2; +% Number of iterations for calculating theta values in gradient descent iterations = 100; -%% +% Perform gradient descent on data to calculate the values for theta that make +% the best hypothesis function. t = gradient_descent(X, y, theta, alpha, iterations, false) % Declare new pair of input features with which to calculate a predicted output