0
$\begingroup$

i'm very new to machine learning, i was doing an exercise about classification using the sigmoid as hypothesis, i don't know what's wrong but my cost function keep increasing and the slope of the cost function is stuck at [-60.000 -149.145 -144.997] X is 100x3 y is 100x1

i'm using octave for easiness

data=load('ex2data1.txt');
X=data(:,[1 2]);
X=[ones( length(X),1) X];
X(:,2)=X(:,2)/min(X(:,2));
X(:,3)=X(:,3)/min(X(:,3));
y=data(:,3);
theta=[0;0;0];
while true,
    h=1./(1+exp(X*theta));
    J=(-y'*log(h)-(1-y')*(1-log(h)))/length(y);
    dJ=(h-y)'*X
    theta=theta-dJ'*01/length(y);
    %pause(0.5);
end

and here is the link for the data https://drive.google.com/open?id=1_7Umhbmf9FkTxbY7egtsNg7u6Qnpe8h3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.