Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [theta, J_history] = gradientDescentMulti(X, y, theta, alpha, num_iters)
- m = length(y);
- J_history = zeros(num_iters, 1);
- for iter = 1:num_iters
- h=theta'*X';
- delta=1/m*(X'*X*theta-X'*y);
- theta=theta-alpha.*delta;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement