Lec 6 - Logistic Regression
Lec 6 - Logistic Regression
Shahid Islam
What is Logistic Regression?
• Logistic regression is a supervised learning algorithm that is used to
predict the dichotomous dependent variable : i.e. binary
• Logistic regression is used to describe data and the relationship
between one dependent variable and one or more independent
variables.
• The independent variables can be nominal, ordinal, or of interval type.
• It is also possible to set up logistic regression with more than two
possible categories (multinomial logistic regression).
Logistic Regression
• Logistic Regression predicts the probability of occurrence of a binary
event utilizing a logit function
• Output from a logistic regression implementation is the estimate of
the probability of a particular event occurring
• the answers it provides are not definitive; they are probabilistic. The
results are calculated based on likelihoods rather than absolute
certainties.
• Logistic regression derives its name from the sigmoid function, which
is also known as the logistic function
• The logistic function is an S-shaped curve that stretches from zero to one,
while never being exactly zero and never being exactly one, either.
Linear Regression Vs Logistic Regression
Sigmoid Function
• The sigmoid function, also called logistic function gives an ‘S’ shaped
curve
• map any real-valued number into a value between 0 and 1
• If the curve goes to positive infinity, y predicted will become 1
• if the curve goes to negative infinity, y predicted will become 0
• If the output of the sigmoid function is more than 0.5, we can classify
the outcome as 1, and if it is less than 0.5, we can classify it as 0
• If the output is 0.75, we can say in terms of probability as: There is a 75
percent chance that a patient will suffer from cancer.
Sigmoid Function
Logistic Regression Assumptions