Print out the cost function J
This commit is contained in:
parent
2bf076c2fc
commit
38064db8b3
1 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,8 @@ for iter = 1:num_iters
|
|||
%
|
||||
theta = theta - (alpha/m) * X' * (X*theta - y);
|
||||
|
||||
J = computeCost(X, y, theta)
|
||||
|
||||
% ============================================================
|
||||
|
||||
% Save the cost J in every iteration
|
||||
|
|
Reference in a new issue