daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Dec 18th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function [theta, J_history] = gradientDescentMulti(X, y, theta, alpha, num_iters)
  2.  
  3. m = length(y);
  4. J_history = zeros(num_iters, 1);
  5.  
  6. for iter = 1:num_iters
  7.  
  8. h=theta'*X';    
  9.  
  10. delta=1/m*(X'*X*theta-X'*y);
  11.  
  12. theta=theta-alpha.*delta;
  13.  
  14. end
  15.  
  16. end
RAW Paste Data
Top