Gradient descent for one variable
This commit is contained in:
parent
514431e135
commit
2bf076c2fc
1 changed files with 4 additions and 9 deletions
|
@ -16,12 +16,7 @@ for iter = 1:num_iters
|
||||||
% Hint: While debugging, it can be useful to print out the values
|
% Hint: While debugging, it can be useful to print out the values
|
||||||
% of the cost function (computeCost) and gradient here.
|
% of the cost function (computeCost) and gradient here.
|
||||||
%
|
%
|
||||||
|
theta = theta - (alpha/m) * X' * (X*theta - y);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
% ============================================================
|
% ============================================================
|
||||||
|
|
||||||
|
|
Reference in a new issue