File Exchange

image thumbnail

Logistic Regression

version (6.81 KB) by earth science learner
Binary Classification is done by making a Decision Boundary through logistic regression approach


Updated 22 Feb 2018

View License

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.

Cite As

earth science learner (2020). Logistic Regression (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Iana Ladygina

Is there a way to see the matrix of coefficients?

Iana Ladygina

Thank you very much! it helped me solve the problem.

haitao liu

Pranoti Khollam

Sevgi Ozturk

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)

Sevgi Ozturk

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);

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux