P 2.1 Logistic Regression
P 2.1 Logistic Regression
2
Course Objective
To study learning
processes:
To provide a
supervised and
comprehensive To understand
To understand the unsupervised,
foundation to modern techniques
history and deterministic and
Machine Learning and practical trends
development of statistical
and Optimization of Machine
Machine Learning. knowledge of
methodology with learning.
Machine learners,
applications t.
and ensemble
learning
3
Logistic Regression
Supervised classification algorithm.
In a classification problem, the target variable(or output), y, can take only
discrete values for given set of features(or inputs), X.
• We can also say that the target variable is categorical.
Logistic Regression
Dependent variable is binary:
1(True, Success) and 0(False, Failure)
Goal is to find best fitting model for independent and dependent
variable relationship.
Independent variables can be continuous or binary.
Logistic Regression
• Logistic Regression was used in the biological sciences in early twentieth century. It was
then used in many social science applications.
• For example,
• To predict whether an email is spam (1) or (0)
• Whether the tumor is malignant (1) or not (0)
5
Types of Logistic Regression
Binomial:
Target variable can have only 2 possible types: “0” or “1” which may
represent “win” vs “loss”, “pass” vs “fail”, “dead” vs “alive”, etc.
Multinomial:
Target variable can have 3 or more possible types which are not
ordered(i.E. Types have no quantitative significance) like “disease A” vs
“disease B” vs “disease C”.
Ordinal:
It deals with target variables with ordered categories. For example, a test
score can be categorized as:“very poor”, “poor”, “good”, “very good”.
Here, each category can be given a score like 0, 1, 2, 3.
Graphical Representation: Logistic Regression
Insurance Data
Logistic Regression vs Linear Regression
Sigmoid function convers input range 0 to 1
1 1
sigmoid ( z ) z
( T xi )
1 e 1 e
e= Euler’s number~2.71828
Logistic Regression
13
Model
• Output = 0 or 1
• Hypothesis => Z = WX + B
• hΘ(x) = sigmoid (Z)
14
Logistic Regression-types
• 1. Binary Logistic Regression
• The categorical response has only two 2 possible outcomes. Example: Spam or Not
• Say, if predicted_value ≥ 0.5, then classify email as spam else as not spam.
16
References
• Books and Journals
• Understanding Machine Learning: From Theory to Algorithms by Shai Shalev-Shwartz and Shai
Ben-David-Cambridge University Press 2014
• Introduction to machine Learning – the Wikipedia Guide by Osman Omer.
• Video Link-
• https://www.youtube.com/watch?v=9f-GarcDY58
• https://www.youtube.com/watch?v=GwIo3gDZCVQ
• Web Link-
• https://towardsdatascience.com/logistic-regression-detailed-overview-46c4da4303bc
17
THANK YOU