0% found this document useful (0 votes)
80 views

P 2.1 Logistic Regression

The document provides information about the course "Machine Learning" including course outcomes, objectives, and an overview of logistic regression. The key points are: - The course aims to provide foundations of machine learning algorithms and applications. Course outcomes include applying ML to problems, understanding algorithms and evaluating models. - Logistic regression is introduced as a supervised classification algorithm used when the target variable is binary. It converts inputs between 0-1 using the sigmoid function unlike linear regression. - The document discusses types of logistic regression, graphical representation, and introduces concepts like decision boundaries for classification.

Uploaded by

madhu jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

P 2.1 Logistic Regression

The document provides information about the course "Machine Learning" including course outcomes, objectives, and an overview of logistic regression. The key points are: - The course aims to provide foundations of machine learning algorithms and applications. Course outcomes include applying ML to problems, understanding algorithms and evaluating models. - Logistic regression is introduced as a supervised classification algorithm used when the target variable is binary. It converts inputs between 0-1 using the sigmoid function unlike linear regression. - The document discusses types of logistic regression, graphical representation, and introduces concepts like decision boundaries for classification.

Uploaded by

madhu jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

University Institute of Engineering

DEPARTMENT OF COMPUTER SCIENCE


& ENGINEERING
Bachelor of Engineering (Computer Science & Engineering)
Subject Name : Machine Learning
Subject Code: CST-316
Topic: Logistic Regression
Lecture-2.1

DISCOVER . LEARN . EMPOWER


Course Outcome
CO-1:Apply the basic concept of Machine learning
and statistics learning to deal with real-life
Problems.

CO-2: Understand different machine learning algorithms,


as well as underlying theories the behind them.

CO-3: Select and apply the appropriate machine learning


algorithm to solve problems of moderate complexity

CO-4: Interpret and evaluate models


generated from data.

CO-5: Optimize the models learned and report on the


expected accuracy that can be attained by applying the

algorithms to a real-world problem .

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. 

• Logistic Regression is used when the dependent variable(target) is categorical.

• 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

• Consider a scenario where we need to classify whether an email is spam or not.


• If we use linear regression for this problem, there is a need for setting up a threshold
based on which classification can be done.
• Say if the actual class is malignant, predicted continuous value 0.4 and the threshold
value is 0.5, the data point will be classified as not malignant which can lead to serious
consequence in real time.
• From this example, it can be inferred that linear regression is not suitable for
classification problem. Linear regression is unbounded, and this brings logistic
regression into picture. Their value strictly ranges from 0 to 1.

13
Model
• Output = 0 or 1
• Hypothesis => Z = WX + B
• hΘ(x) = sigmoid (Z)

• If ‘Z’ goes to infinity,


Y(predicted) will become 1
and if ‘Z’ goes to negative
infinity, Y(predicted) will
become 0.

14
Logistic Regression-types
• 1. Binary Logistic Regression
• The categorical response has only two 2 possible outcomes. Example: Spam or Not

• 2. Multinomial Logistic Regression


• Three or more categories without ordering. Example: Predicting which food is preferred
more (Veg, Non-Veg, Vegan)

• 3. Ordinal Logistic Regression


• Three or more categories with ordering. Example: Movie rating from 1 to 5
15
Decision Boundary

• To predict which class a data belongs, a threshold can be set.


• Based upon this threshold, the obtained estimated probability is classified into classes.

• Say, if predicted_value ≥ 0.5, then classify email as spam else as not spam.

• Decision boundary can be linear or non-linear.


• Polynomial order can be increased to get complex decision boundary.

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

You might also like