Logistic Regression : classification algorithm

habibaabderrahim1 185 views 16 slides Aug 10, 2024
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

Regression is one of the most common models of machine learning .
Logistic regression is a classification algorithm


Slide Content

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 :

If the curve goes to positive infinity, y predicted will become 1, and if the curve goes to negative
infinity, y predicted 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