2. 1
Introduction
• What is Logistic Regression
Logistic Function & Odds
• Logistic function(sigmoid function)
• Odds
Binomial Logistic Regression
• Bionomial logistic regression
Estimation
• Maximum Likehood Estimation
• Gradient
Multinomial Logistic Regression
• Multinomial logistic regression
Linear Regression vs. Logistic Regression
• Linear Regression vs. Logistic Regression
Q / A
3. 2
1. Introduction
what is Logistic Regression
• Logistic regression is a supervised machine learning algorithm mainly used for classification tasks where the
goal is to predict the probability that an instance of belonging to a given class or not. It is a kind of statistical
algorithm, which analyze the relationship between a set of independent variables and the dependent binary
variables. It is a powerful tool for decision-making. For example, there is a email spam or not.
4. 3
2. Logistic Function & Odds
Logistic Function
• The S-form curve is called the Sigmoid function or the logistic function.
5. 4
2. Logistic Function & Odds
Odds
• Odds : It is the ratio of something occurring to something not occurring. it is different from probability as the
probability is the ratio of something occurring to everything that could possibly occur.
7. 6
4. Estimation
Maximum Likelihood Estimation
likehood function :
log - likehood function :
maximum likelihood estimation (MLE) is a method of estimating the
parameters of an assumed probability distribution, given some observed data.
10. 9
5. Multinomial Logistic Regression
Multinomial Logistic Regression
• Y = 1, 2 or 3 (Categories : 3) • Y = 1, 2, ... or k (Categories : K)
P(Y=3) = 1 - (P(Y = 1) + P(Y = 2))
11. 10
6. Linear Regression vs. Logistic Regression
Linear Regrssion
• It is used for solving Regression problem.
• In this, we find best fit line.
• Least square estimation method is used
for estimation of accuracy.
• The output must be continuous value
• It required linear relationship between
dependent and independent variables.
Logistic Regression
• It is used for solving classification problems.
• In this, we find S-Curve .
• Maximum likelihood estimation method is used for
Estimation of accuracy.
• Output is must be categorical value
• It not required linear relationship.
The S-form curve is called the Sigmoid function or the logistic function.
input is all real number. but, output is bounded to 0 to 1.
Odds : It is the ratio of something occurring to something not occurring. it is different from probability as the probability is the ratio of something occurring to everything that could possibly occur.
odds equal to probability A over 1 - probability A.
the graph shows odds is increasing infinitely as probability A is aproaching to 1.
By using odds, we get the equation of binomial logistic regression.
where z is beta transpose x
we should find optimal beta
in binomial logistic function, where y =1, if the value of function is less than 1/2, it is classified as 0.
if the value of function is more than 1/2, it is classified as 1.
To find optimal beta, we use maximumlikelyhood estimation
maximum likelihood estimation (MLE) is a method of estimating the parameters of an assumed probability distribution, given some observed data.
likelyhood function for binomial logistic regression
To find the maximum likelyhood estimation, we diffrerentiate with respect to w and b.
The values of w and b that make the equation go to zero are the optimal beta.
lets consider when categories are three. we can solve the problem with two logistic regression model.
Using the fact that the probability of being in the third category = 1 - the probability of being in the first category - the probability of being in the second category, we can combine and substitute the above two formulas to get the following for each category.
similiarly, we can solve the problem when categories are K.
in this case, the probability of