W8 - Logistic Regression
W8 - Logistic Regression
Likelihood Vs Probability
Probability vs Statistics
• In probability theory we consider some underlying process which has
some randomness or uncertainty modeled by random variables, and
we figure out what happens.
• In statistics we observe something that has happened, and try to
figure out what underlying process would explain those observations.
• Likelihood function is a fundamental concept in statistical inference.
• It indicates how likely a particular population is to produce an
observed sample.
• Probability points to chances while likelihood denotes a possibility.
Likelihood Vs Probability
• Probability is simply how likely something is to happen.
• The occurrence of discrete values yk is expressed by the probability P(yk).
• The distribution of all possible values of discrete random variable y is
expressed as probability distribution.
• We assume that there is some a priori probability (or simply prior) P(yk)
that the next feature vector belongs to the class k.
• P(x| yk) is called the class likelihood and is the conditional probability that a
pattern belonging to class yk has the associated observation value x.
• Any class that maximizes P(x| yq) is called Maximum Likelihood (ML) class.
Likelihood Vs Probability
• Probability follows clear parameters and computations while a likelihood is
based merely on observed factors/data.
1.9 3.1 ?
Example 1
• Training involves finding optimal
values of coefficients which are B0,
β1, and β2.
• While training, we find some value
of coefficients in the first step and
use those coefficients in another
step to optimize their value.
• We continue to do it until we get
consistent accuracy from the model.
=
1.9 3.1 ?
Example 1
• After 20 iteration, we get:
B0 = -0.1068913
B1 = 0.41444855
B2 = -0.2486209
• Thus, the decision boundary is given
as:
Z = B0+B1*X1+B2*X2
Z = -0.1068913 +0.41444855*Time-
0.2486209*Sentences
1.9 3.1 ?
Example 1
• For, X1 = 1.9 and X2 = 3.1, we get:
Z = -0.101818+0.41444855*1.9 -
0.2486209*3.1
Z = -0.085090545
• Now, we use sigmoid function to
find the probability and thus
predicting the class of given
variables.