Compute the cost function for logistic regression
This commit is contained in:
parent
b863a3863e
commit
8c100a3f49
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ grad = zeros(size(theta));
|
|||
%
|
||||
% Note: grad should have the same dimensions as theta
|
||||
%
|
||||
|
||||
J = 1/m * (-y'*log(sigmoid(X*theta)) - (1-y)'*log(1-sigmoid(X*theta)));
|
||||
|
||||
|
||||
|
||||
|
|
Reference in a new issue