Logistic regression is a classification approach for different classes of data in order to predict whether a data point belongs to one class or another. Sigmoid hypothesis function is used to calculate the probability of y belonging to a particular class. Training data is normalized using Zscore.
earth science learner (2020). Logistic Regression (https://www.mathworks.com/matlabcentral/fileexchange/66161-logistic-regression), MATLAB Central File Exchange. Retrieved .
Is there a way to see the matrix of coefficients?
Thank you very much! it helped me solve the problem.
Ok, you're using loglikehood of objective function, not a cost/loss function. I misinterpreted ur J as loss function!
Then you're right, it should be : th=th+(alpha/m)*xtrain'*(ytrain-h)
In cost.m, don't you think there is a missing part in the formula : th=th+(alpha/m)*xtrain'*(ytrain-h)
In should be : th=th+(alpha/m)*xtrain'*(ytrain-h)*h*(1-h).
So, last three terms of this multiplication should indicate dJ/dz=(ytrain-h)*h*(1-h);