Logistic Regression
Logistic Regression
Logistic Regression
• Consider the following Example:- An organization want to determine an
employee's salary hike based on their performance.
Y = Salary hike(Dependent variable)
X = Rating of employee(Independent Variable)
There is a relationship between X and Y and they are
Proportional to each other
Now lets take another
scenario
• Consider an example :- Whether The
employee should get Promotion or not
• Now there is option based answer : Yes
Or NO
Problems With linear regression
• Linear Regression predicts the numerical response but is not suitable for the
categorical values such as (Gender – Male/female, Result – Pass Or Fail, Yes
Or No, True or False)
• When categorical data is involved, we use classification.
• In binary classification we use logistic regression.
LOGISTIC REGRESSION
• When There is 2 Binary categorical data set then we use logistic regression.
• We find out the probability from 0 to 1 and then classify the data.
• 0 represents there is no possibility of an happening of an event.
• 1 represents there is a possibility of an happening of an event.
• The data set should be free of missing values.
EXAMPLE
• Consider an example :- Whether The employee should get performance or
not.
• Now we will make a Sigmoid Curve(S Curve)
• Now based on thresholds the company will decide whether the employee
should her promotion or not.
SIGMOID FUNCTION
𝟏
• Formula : 𝒚 =
𝟏 𝒆 𝒙
Let's Consider an Numerical example
• The student data set has entrance marks based on the historical data of those
who are selected or not selected.
• The permeameters are given are 𝛽 = 1 𝑎𝑛𝑑 𝐵 = 8
• Assuming Marks x = 60 compute the result.
Let's Compute it
𝟏
•𝒑𝒙 = 𝟏 𝒆 𝒙
: 𝒙 = 𝜷𝟎 + 𝜷𝟏 𝒙𝟏 Here e is Euler’s Constant = 2.718
= 1 + 8*6 = 481
𝟏
𝒚= 𝟒𝟖𝟏 = 0.44
𝟏 + 𝟐 ⋅ 𝟕𝟏𝟖