1
0
Fork 0

Compute the gradient for logistic regression

master
neingeist 10 years ago
parent 8c100a3f49
commit 31c4ac1967

@ -21,7 +21,7 @@ grad = zeros(size(theta));
%
J = 1/m * (-y'*log(sigmoid(X*theta)) - (1-y)'*log(1-sigmoid(X*theta)));
grad = 1/m * X' * (sigmoid(X*theta) - y);