Logistic
Regression
Introduction
logistic Regression : what , when and
how ?
Advantages and Disadvantages
Uses cases
Demo
Introduction
What is Regression?
Regression is one of the most common models of machine learning , it is a way of
predicting future happenings between a dependent (target) and one or more
independent (predictor) variables .
3
Regression
Linear regression Logistic regression
Polynomial
regression
logistic Regression :
What ?
Logistic regression is a classification algorithm used to assign observations to a discrete set of
classes , In other words,the outcome or target variable is dichotomous in nature , which means it
can only have one of two values (either 0 or 1, true or false, black or white, spam or not spam, and so
on … )
logistic Regression :
When ?
logistic Regression :
How ?
Logistic Regression predicts the probability of occurrence of a binary event utilizing what we call
logit function or Sigmoid function .
The hypothesis of logistic regression :
ted will become 0.
The hypothesis of logistic regression :
1. Linear Regression fonction :
1. Sigmoid Function:
1. Apply Sigmoid function on linear regression:
Example
Does a patient have a lung cancer ?
New Data
Best Fit
Maximum likelihood
Optimization
The Cost function of Logistic regression
Cost Function
The cost function represents optimization objective i.e. we create a cost function
and minimize it so that we can develop an accurate model with minimum error.
Gradient Descent
Gradient descent is an optimization algorithm ,
The main goal of it is to minimize the cost value.
Objective: To minimize the cost function we have to run the gradient
descent function on each parameter .
12
Uses Cases
Logistic Regression has a wide range of real-life applications :
medical fields
13
Social sciences
Marketing fields
Advantages
❖ Useful on problems where you need to give
more rationale for a prediction
❖ Doesn't require high computation power
❖ Easy to implement and to interpret
❖ Used widely by data analyst and scientist
❖ Logistic regression provides a probability
score for observations
Disadvantages
❖ Logistic regression is not able to handle a
large number of categorical features.
❖ Logistic regression will not perform well
with independent variables that are not
correlated to the target variable and are
very similar or correlated to each other.
“
▸ Thank you !
16

Logistic Regression : classification algorithm

  • 1.
  • 2.
    Introduction logistic Regression :what , when and how ? Advantages and Disadvantages Uses cases Demo
  • 3.
    Introduction What is Regression? Regressionis one of the most common models of machine learning , it is a way of predicting future happenings between a dependent (target) and one or more independent (predictor) variables . 3 Regression Linear regression Logistic regression Polynomial regression
  • 4.
    logistic Regression : What? Logistic regression is a classification algorithm used to assign observations to a discrete set of classes , In other words,the outcome or target variable is dichotomous in nature , which means it can only have one of two values (either 0 or 1, true or false, black or white, spam or not spam, and so on … )
  • 5.
  • 6.
    logistic Regression : How? Logistic Regression predicts the probability of occurrence of a binary event utilizing what we call logit function or Sigmoid function . The hypothesis of logistic regression : ted will become 0.
  • 7.
    The hypothesis oflogistic regression : 1. Linear Regression fonction : 1. Sigmoid Function: 1. Apply Sigmoid function on linear regression:
  • 8.
    Example Does a patienthave a lung cancer ?
  • 9.
  • 10.
  • 11.
    Optimization The Cost functionof Logistic regression Cost Function The cost function represents optimization objective i.e. we create a cost function and minimize it so that we can develop an accurate model with minimum error.
  • 12.
    Gradient Descent Gradient descentis an optimization algorithm , The main goal of it is to minimize the cost value. Objective: To minimize the cost function we have to run the gradient descent function on each parameter . 12
  • 13.
    Uses Cases Logistic Regressionhas a wide range of real-life applications : medical fields 13 Social sciences Marketing fields
  • 14.
    Advantages ❖ Useful onproblems where you need to give more rationale for a prediction ❖ Doesn't require high computation power ❖ Easy to implement and to interpret ❖ Used widely by data analyst and scientist ❖ Logistic regression provides a probability score for observations
  • 15.
    Disadvantages ❖ Logistic regressionis not able to handle a large number of categorical features. ❖ Logistic regression will not perform well with independent variables that are not correlated to the target variable and are very similar or correlated to each other.
  • 16.