Added comments to mllab2
This commit is contained in:
@@ -10,10 +10,13 @@ X = [ones(size(X, 1), 1), X];
|
|||||||
|
|
||||||
%initialise theta
|
%initialise theta
|
||||||
theta = [0.0, 0.0, 0.0];
|
theta = [0.0, 0.0, 0.0];
|
||||||
|
% Learning rate
|
||||||
alpha = 0.2;
|
alpha = 0.2;
|
||||||
|
% Number of iterations for calculating theta values in gradient descent
|
||||||
iterations = 100;
|
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)
|
t = gradient_descent(X, y, theta, alpha, iterations, false)
|
||||||
|
|
||||||
% Declare new pair of input features with which to calculate a predicted output
|
% Declare new pair of input features with which to calculate a predicted output
|
||||||
|
|||||||
Reference in New Issue
Block a user