SlideShare a Scribd company logo
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
What Will You Learn Today?
What is Regression?
The 5 Questions
asked in Data Science
Logistic Regression – What
and Why?
How does Logistic
Regression work?
Demo In R: Diabetes
Use Case
1 2 3
4 65
Logistic Regression –
Use Cases
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
The 5 Questions Asked In Data
Science
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
The 5 Questions Asked In Data Science
In data science, basically we have 5 kind of problems.
Classification Algorithm
Anomaly Detection Algorithm
Regression Algorithms
Clustering Algorithms
Reinforcement Learning
Q1.
Q2.
Q4.
Q3.
Q5.
Is this A or B?
Is this weird?
How much or how many?
How is this organized?
What should I do next?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
The 5 Questions Asked In Data Science
In data science, basically we have 5 kind of problems.
Q1.
Q2.
Q4.
Q3.
Q5.
Is this A or B?
Is this weird?
How is this organized?
What should I do next?
Classification Algorithm
Anomaly Detection Algorithm
Regression Algorithms
Clustering Algorithms
Reinforcement Learning
How much or how many?
Is this A or B?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
What Is Regression?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
What Is Regression?
➢ Regression analysis is a predictive
modelling technique.
➢ It estimates the relationship between
a dependent (target) and an
independent variable (predictor).
Input value = 7.00
Predicted outcome = 123.9
X-axis
Y-axis
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Types Of Regression
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Types Of Regression
Linear Regression
• When there is a linear
relationship between
independent and dependent
variables.
• When the dependent variable is
categorical (0/ 1, True/ False, Yes/
No, A/B/C) in nature.
Logistic Regression Polynomial Regression
• When the power of independent
variable is more than 1.
X
Y
X
Y
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Types Of Regression
Linear Regression
• When there is a linear
relationship between
independent and dependent
variables.
• When the dependent variable is
categorical (0/ 1, True/ False, Yes/
No, A/B/C) in nature.
Logistic Regression Polynomial Regression
• When the power of independent
variable is more than 1.
X
Y
X
Y
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why Logistic Regression?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why Logistic Regression?
Whenever the outcome of the dependent variable (Y) is discrete, like 0 or 1, Yes or No, A, B or C, we use
logistic regression.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why can’t we use Linear Regression?
Why Not Linear Regression?
Whenever the outcome of the dependent variable (Y) is discrete, like 0 or 1, Yes or No, A, B or C, we use
logistic regression.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Y-axis
X-axis
0
1
Now since our value of Y will be between 0 and 1, the linear line has to be clipped at 0 and 1.
Why Not Linear Regression?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Y-axis
X-axis
0
1
With this, our resulting curve cannot be formulated into a single formula. We needed a new way to solve this kind of problem.
Hence, we came up with Logistic Regression!
Why Not Linear Regression?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
0
0.2
0.4
0.6
0.8
1
1.2
0 1 2 3 4 5 6 7 8 9 10
LOGISTIC REGRESSION
The S Curve
Logistic Regression Curve
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why Logistic Regression?
Equation for a straight line
Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why Logistic Regression?
Equation for a straight line
Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity
Let’s try to reduce the Logistic Regression Equation from this equation
Y = C + B1X1 + B2X2 + …. In Logistic Regression Y can only be between 0 and 1.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why Logistic Regression?
Equation for a straight line
Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity
Let’s try to reduce the Logistic Regression Equation from this equation
Y = C + B1X1 + B2X2 + …. In Logistic Equation Y can only be between 0 and 1.
Now, to get the range of Y between 0 and infinity, let’s transform Y
Y
1 − Y
Y=0 | 0
Y=1 | infinity
Now, we have the range between 0 and infinity
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Why Logistic Regression?
Equation for a straight line
Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity
Let’s try to reduce the Logistic Regression Equation from this equation
Y = C + B1X1 + B2X2 + …. In Logistic Equation Y can only be between 0 and 1.
Now, to get the range of Y between 0 and infinity, let’s transform Y
Y
1 − Y
Y=0 | 0
Y=1 | infinity
Now, we have the range between 0 and infinity
Let us transform it further, to get the range between –( infinity ) and infinity
Y
1 − Y
log
𝐘
𝟏 − 𝐘
log = C + B1X1 + B2X2 + ….
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
What Is Logistic Regression?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
What Is Logistic Regression?
Logistic regression, or logit regression, or logit model is a regression model where the dependent variable (DV) is categorical.
DependentCategorical
Variables that can have only fixed values
such as A, B or C, Yes or No
Y = f(X)
i.e Y is dependent on X.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Therefore, whenever the outcome of the dependent variable (Y) is categorical, like 0 or 1, Yes or No, A, B or
C, we use logistic regression.
What Is Logistic Regression?
0.0
1.0
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Let us take an example to understand this:
MODEL
Selected
147, 120, 121, 128, 110,
119, 133
Not Selected
107, 89, 92, 106, 104,
114
How does Logistic Regression Work?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Let us take an example to understand this:
MODEL
Selected
147, 120, 121, 128, 110,
119, 133
Not Selected
107, 89, 92, 106, 104,
114
How does Logistic Regression Work?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
Let’s take a sample dataset in R, which is called mtcars.
Our aim is to predict whether a car will have a V-engine or
a Straight engine based on our inputs.
Mpg - Miles/US Gallon
Cyl – Number of cylinders
Disp – Number of cylinders
Hp – Gross horsepower
Drat – Rear axle ratio
Wt – Weight (lb/1000)
Qsec – 1/4 mile time
Vs – V Engine
Am – Transmission Type
Gear – Number of forward gears
Carb - Number of carburetors
Key
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
For now, let’s take disp and wt as our primary
independent variables. Why? We’ll be discussing it in
our next section.
Mpg - Miles/US Gallon
Cyl – Number of cylinders
Disp – Number of cylinders
Hp – Gross horsepower
Drat – Rear axle ratio
Wt – Weight (lb/1000)
Qsec – 1/4 mile time
Vs – V Engine
Am – Transmission Type
Gear – Number of forward gears
Carb - Number of carburetors
Key
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
Since our aim is to know which engine will fit, the engine will
either be V – type or not, i.e either 1 or 0. Therefore, our
dependent variable is Y.
Mpg - Miles/US Gallon
Cyl – Number of cylinders
Disp – Number of cylinders
Hp – Gross horsepower
Drat – Rear axle ratio
Wt – Weight (lb/1000)
Qsec – 1/4 mile time
Vs – V Engine
Am – Transmission Type
Gear – Number of forward gears
Carb - Number of carburetors
Key
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
Before creating the model, we divide our dataset
into training and testing.
80 %
20%
Training Dataset
Testing Dataset
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
Training to create our model and testing to validate it.
80 %
Create model from this Training Dataset
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How Does Logistic Regression Work?
Once the model is created we get the following
outputs, which are calculated using MLE*.
𝛽°
𝛽1
𝛽2
*Maximum Likelihood Estimation is a method of estimating the parameters.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Estimated Regression Equation
Estimated Regression Equation:
Here,
β° = Constant Coefficient
𝛽1 = Coefficient of x1
𝛽2 = Coefficient of x2
𝑥1 = Independent variable
𝑥2 = Independent variable
e = Euler’s Number
P(Y) = Probability that Y equals 1
𝑒
𝛽
°
+ 𝛽1 𝑥 1+ 𝛽2 𝑥 2
1 + 𝑒
𝛽
°
+ 𝛽1 𝑥 1+ 𝛽2 𝑥 2
Logit (Y) =
Y
1 − Y
log =
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Substituting Values
Let’s take a value from the test dataset
How Does Logistic Regression Work?
0.9849
1.9849
= = 0.4962
β° = 1.83010
β1 = 1.09428
β2 = - 0.02529
e = 2.7183
X1 = 120.3
X2 = 2.140
= 0.4962Probability of ‘vs’ being ‘1’ We will assume the
threshold to be 0.5
Hence our car will not have a VS engine and hence have a straight engine.
Logit (Y)
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Substituting Values
Let’s take a value from the test dataset
How Does Logistic Regression Work?
0.9849
1.9849
= = 0.4962
β° = 1.83010
β1 = 1.09428
β2 = - 0.02529
e = 2.7183
X1 = 120.3
X2 = 2.140
= 0.4962Probability of ‘vs’ being ‘1’ We will assume the
threshold to be 0.5
Hence our car will not have a VS engine and hence have a straight engine.
Logit (Y)
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
Key
Npreg – number of pregnancies
Glu – plasma glucose concentration
Bp – diastolic blood pressure
Skin – triceps skin fold thickness
Bmi – body mass index
Ped – diabetes pedigree function
Age – age in years
Type – 1 for yes and 0 for No for diabetic
Our aim is to predict whether a patient is diabetic or not based on the following values.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
First, we will read the data from our CSV file, by entering this command:
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
First, we will read the data from our CSV file, by entering this command:
Then, we will split our dataset into training and testing, with the ratio 8:2
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
First, we will read the data from our CSV file, by entering this command:
Then, we will split our dataset into training and testing, with the ratio 8:2
After that we’ll create our model using the training dataset
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
The summary of the model will give this.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
The summary of the model will give this.
*** - 99.9% confident
** - 99% confident
* - 95% confident
. - 90% confident
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
• This is the summary model that we get
after improving our model.
• So the insignificant fields is skin
Logistic Regression Demo In R
Null deviance shows how
well the response variable
is predicted by a model
that includes only the
intercept (grand mean)
Residual deviance shows
how well the response
variable is predicted with
inclusion of independent
variables.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
We will the predict the values for the test dataset and
then categorize them according to threshold which is 0.5
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
We will the predict the values for the test dataset and
then categorize them according to threshold which is 0.5
Create Confusion Matrix for the training dataset
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
We will the predict the values for the test dataset and
then categorize them according to threshold which is 0.5
And then finding the accuracy
Create Confusion Matrix for the training dataset
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
How To Find The Threshold?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we
created.
Store the predicted values for training
dataset in ‘res’ variable
Logistic Regression Demo In R
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we
created.
Store the predicted values for training
dataset in ‘res’ variable
Logistic Regression Demo In R
Import the library for the ROCR package
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we
created.
Store the predicted values for training
dataset in ‘res’ variable
Logistic Regression Demo In R
Import the library for the ROCR package
Define the ‘ROCRPred’ and and ‘ROCRPerf’
variables
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we
created.
Store the predicted values for training
dataset in ‘res’ variable
Logistic Regression Demo In R
Import the library for the ROCR package
Define the ‘ROCRPred’ and and ‘ROCRPerf’
variables
Plot the graph!
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
Confusion Matrix for Test Dataset with 0.5
threshold
Confusion Matrix for Test Dataset with 0.3
threshold
Accuracy = 73.8%
TrueNegatives = 9
Accuracy = 67.8%
TrueNegatives = 5
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression Demo In R
Confusion Matrix for Test Dataset with 0.5
threshold
Confusion Matrix for Test Dataset with 0.3
threshold
Accuracy = 73.8%
TrueNegatives = 9
Accuracy = 67.8%
TrueNegatives = 5
Confusion Matrix for Training Dataset with
0.3 threshold
Accuracy = 79.4%
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression: Use Cases
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression – Use Case
• Logistic Regression was used in
conjugation with Geographic Information
system in 2005, to predict the malaria
breeding grounds in Africa.
• Logistic regression was used to
approximate areas where malaria patients
would exist based on geographical inputs.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Logistic Regression – Use Case
• Logit analysis is a statistical technique used
by marketers to assess the scope of customer
acceptance of a product, particularly a new product.
• It attempts to determine the intensity or magnitude of
customers' purchase intentions and translates that
into a measure of actual buying behavior.
• Many e-commerce websites assess this behavior using
this model.
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Session In A Minute
The 5 Questions In Data Science
Use CasesLogistic Regression Working?
Logistic Regression – What & Why?
Demo
What Is Regression?
www.edureka.co/data-scienceEdureka’s Data Science Certification Training
Course Details
Go to www.edureka.co/data-science
Get Edureka Certified in Data Science Today!
What our learners have to say about us!
Shravan Reddy says- “I would like to recommend any one who
wants to be a Data Scientist just one place: Edureka. Explanations
are clean, clear, easy to understand. Their support team works
very well.. I took the Data Science course and I'm going to take
Machine Learning with Mahout and then Big Data and Hadoop”.
Gnana Sekhar says - “Edureka Data science course provided me a very
good mixture of theoretical and practical training. LMS pre recorded
sessions and assignments were very good as there is a lot of
information in them that will help me in my job. Edureka is my
teaching GURU now...Thanks EDUREKA.”
Balu Samaga says - “It was a great experience to undergo and get
certified in the Data Science course from Edureka. Quality of the
training materials, assignments, project, support and other
infrastructures are a top notch.”
www.edureka.co/data-scienceEdureka’s Data Science Certification Training

More Related Content

What's hot

Data Science Training | Data Science For Beginners | Data Science With Python...
Data Science Training | Data Science For Beginners | Data Science With Python...Data Science Training | Data Science For Beginners | Data Science With Python...
Data Science Training | Data Science For Beginners | Data Science With Python...
Simplilearn
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic Regression
Knoldus Inc.
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Edureka!
 
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Edureka!
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
MartinHogg9
 
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
Simplilearn
 
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Simplilearn
 
ML - Simple Linear Regression
ML - Simple Linear RegressionML - Simple Linear Regression
ML - Simple Linear Regression
Andrew Ferlitsch
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
VARUN KUMAR
 
Probability Theory for Data Scientists
Probability Theory for Data ScientistsProbability Theory for Data Scientists
Probability Theory for Data Scientists
Ferdin Joe John Joseph PhD
 
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Edureka!
 
KNN
KNN KNN
PCA (Principal component analysis)
PCA (Principal component analysis)PCA (Principal component analysis)
PCA (Principal component analysis)
Learnbay Datascience
 
Linear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in MLLinear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in ML
Kumud Arora
 
Classification and prediction
Classification and predictionClassification and prediction
Classification and prediction
Acad
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
YashwantGahlot1
 
Linear regression
Linear regressionLinear regression
Linear regression
Karishma Chaudhary
 
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
Edureka!
 
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Edureka!
 
3.7 outlier analysis
3.7 outlier analysis3.7 outlier analysis
3.7 outlier analysis
Krish_ver2
 

What's hot (20)

Data Science Training | Data Science For Beginners | Data Science With Python...
Data Science Training | Data Science For Beginners | Data Science With Python...Data Science Training | Data Science For Beginners | Data Science With Python...
Data Science Training | Data Science For Beginners | Data Science With Python...
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic Regression
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
 
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
 
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
Linear Regression Analysis | Linear Regression in Python | Machine Learning A...
 
ML - Simple Linear Regression
ML - Simple Linear RegressionML - Simple Linear Regression
ML - Simple Linear Regression
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Probability Theory for Data Scientists
Probability Theory for Data ScientistsProbability Theory for Data Scientists
Probability Theory for Data Scientists
 
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
 
KNN
KNN KNN
KNN
 
PCA (Principal component analysis)
PCA (Principal component analysis)PCA (Principal component analysis)
PCA (Principal component analysis)
 
Linear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in MLLinear Regression and Logistic Regression in ML
Linear Regression and Logistic Regression in ML
 
Classification and prediction
Classification and predictionClassification and prediction
Classification and prediction
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
 
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
 
3.7 outlier analysis
3.7 outlier analysis3.7 outlier analysis
3.7 outlier analysis
 

Similar to Logistic Regression in R | Machine Learning Algorithms | Data Science Training | Edureka

Fast Distributed Online Classification
Fast Distributed Online Classification Fast Distributed Online Classification
Fast Distributed Online Classification
DataWorks Summit/Hadoop Summit
 
CHAPTER 11 LOGISTIC REGRESSION.pptx
CHAPTER 11 LOGISTIC REGRESSION.pptxCHAPTER 11 LOGISTIC REGRESSION.pptx
CHAPTER 11 LOGISTIC REGRESSION.pptx
UmaDeviAnanth
 
Fast Distributed Online Classification
Fast Distributed Online ClassificationFast Distributed Online Classification
Fast Distributed Online Classification
Prasad Chalasani
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
ajondaree
 
Kaggle KDD Cup Report
Kaggle KDD Cup ReportKaggle KDD Cup Report
Kaggle KDD Cup Report
Chamila Wijayarathna
 
Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms
Learnbay Datascience
 
Machine learning Algorithms with a Sagemaker demo
Machine learning Algorithms with a Sagemaker demoMachine learning Algorithms with a Sagemaker demo
Machine learning Algorithms with a Sagemaker demo
Hridyesh Bisht
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learning
Yogendra Singh
 
Machine_Learning.pptx
Machine_Learning.pptxMachine_Learning.pptx
Machine_Learning.pptx
VickyKumar131533
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithms
Arunangsu Sahu
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
Dr Nisha Arora
 
ML Study Jams - Session 3.pptx
ML Study Jams - Session 3.pptxML Study Jams - Session 3.pptx
ML Study Jams - Session 3.pptx
MayankChadha14
 
3ml.pdf
3ml.pdf3ml.pdf
3ml.pdf
MianAdnan27
 
C3.2.2
C3.2.2C3.2.2
C3.2.2
Daniel LIAO
 
Eco550 Assignment 1
Eco550 Assignment 1Eco550 Assignment 1
Eco550 Assignment 1
Lisa Kennedy
 
Supervised learning - Linear and Logistic Regression( AI, ML)
Supervised learning - Linear and Logistic Regression( AI, ML)Supervised learning - Linear and Logistic Regression( AI, ML)
Supervised learning - Linear and Logistic Regression( AI, ML)
Rahul Pal
 
Neural Network Model
Neural Network ModelNeural Network Model
Neural Network Model
Eric Esajian
 
WEKA:Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been LearnedWEKA:Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been Learned
weka Content
 
WEKA: Credibility Evaluating Whats Been Learned
WEKA: Credibility Evaluating Whats Been LearnedWEKA: Credibility Evaluating Whats Been Learned
WEKA: Credibility Evaluating Whats Been Learned
DataminingTools Inc
 
shuyangli_summerpresentation08082014
shuyangli_summerpresentation08082014shuyangli_summerpresentation08082014
shuyangli_summerpresentation08082014
Shuyang Li
 

Similar to Logistic Regression in R | Machine Learning Algorithms | Data Science Training | Edureka (20)

Fast Distributed Online Classification
Fast Distributed Online Classification Fast Distributed Online Classification
Fast Distributed Online Classification
 
CHAPTER 11 LOGISTIC REGRESSION.pptx
CHAPTER 11 LOGISTIC REGRESSION.pptxCHAPTER 11 LOGISTIC REGRESSION.pptx
CHAPTER 11 LOGISTIC REGRESSION.pptx
 
Fast Distributed Online Classification
Fast Distributed Online ClassificationFast Distributed Online Classification
Fast Distributed Online Classification
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
 
Kaggle KDD Cup Report
Kaggle KDD Cup ReportKaggle KDD Cup Report
Kaggle KDD Cup Report
 
Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms
 
Machine learning Algorithms with a Sagemaker demo
Machine learning Algorithms with a Sagemaker demoMachine learning Algorithms with a Sagemaker demo
Machine learning Algorithms with a Sagemaker demo
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learning
 
Machine_Learning.pptx
Machine_Learning.pptxMachine_Learning.pptx
Machine_Learning.pptx
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithms
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
 
ML Study Jams - Session 3.pptx
ML Study Jams - Session 3.pptxML Study Jams - Session 3.pptx
ML Study Jams - Session 3.pptx
 
3ml.pdf
3ml.pdf3ml.pdf
3ml.pdf
 
C3.2.2
C3.2.2C3.2.2
C3.2.2
 
Eco550 Assignment 1
Eco550 Assignment 1Eco550 Assignment 1
Eco550 Assignment 1
 
Supervised learning - Linear and Logistic Regression( AI, ML)
Supervised learning - Linear and Logistic Regression( AI, ML)Supervised learning - Linear and Logistic Regression( AI, ML)
Supervised learning - Linear and Logistic Regression( AI, ML)
 
Neural Network Model
Neural Network ModelNeural Network Model
Neural Network Model
 
WEKA:Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been LearnedWEKA:Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been Learned
 
WEKA: Credibility Evaluating Whats Been Learned
WEKA: Credibility Evaluating Whats Been LearnedWEKA: Credibility Evaluating Whats Been Learned
WEKA: Credibility Evaluating Whats Been Learned
 
shuyangli_summerpresentation08082014
shuyangli_summerpresentation08082014shuyangli_summerpresentation08082014
shuyangli_summerpresentation08082014
 

More from Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Recently uploaded

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 

Recently uploaded (20)

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 

Logistic Regression in R | Machine Learning Algorithms | Data Science Training | Edureka

  • 1. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression
  • 2. www.edureka.co/data-scienceEdureka’s Data Science Certification Training What Will You Learn Today? What is Regression? The 5 Questions asked in Data Science Logistic Regression – What and Why? How does Logistic Regression work? Demo In R: Diabetes Use Case 1 2 3 4 65 Logistic Regression – Use Cases
  • 3. www.edureka.co/data-scienceEdureka’s Data Science Certification Training The 5 Questions Asked In Data Science
  • 4. www.edureka.co/data-scienceEdureka’s Data Science Certification Training The 5 Questions Asked In Data Science In data science, basically we have 5 kind of problems. Classification Algorithm Anomaly Detection Algorithm Regression Algorithms Clustering Algorithms Reinforcement Learning Q1. Q2. Q4. Q3. Q5. Is this A or B? Is this weird? How much or how many? How is this organized? What should I do next?
  • 5. www.edureka.co/data-scienceEdureka’s Data Science Certification Training The 5 Questions Asked In Data Science In data science, basically we have 5 kind of problems. Q1. Q2. Q4. Q3. Q5. Is this A or B? Is this weird? How is this organized? What should I do next? Classification Algorithm Anomaly Detection Algorithm Regression Algorithms Clustering Algorithms Reinforcement Learning How much or how many? Is this A or B?
  • 6. www.edureka.co/data-scienceEdureka’s Data Science Certification Training What Is Regression?
  • 7. www.edureka.co/data-scienceEdureka’s Data Science Certification Training What Is Regression? ➢ Regression analysis is a predictive modelling technique. ➢ It estimates the relationship between a dependent (target) and an independent variable (predictor). Input value = 7.00 Predicted outcome = 123.9 X-axis Y-axis
  • 8. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Types Of Regression
  • 9. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Types Of Regression Linear Regression • When there is a linear relationship between independent and dependent variables. • When the dependent variable is categorical (0/ 1, True/ False, Yes/ No, A/B/C) in nature. Logistic Regression Polynomial Regression • When the power of independent variable is more than 1. X Y X Y
  • 10. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Types Of Regression Linear Regression • When there is a linear relationship between independent and dependent variables. • When the dependent variable is categorical (0/ 1, True/ False, Yes/ No, A/B/C) in nature. Logistic Regression Polynomial Regression • When the power of independent variable is more than 1. X Y X Y
  • 11. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why Logistic Regression?
  • 12. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why Logistic Regression? Whenever the outcome of the dependent variable (Y) is discrete, like 0 or 1, Yes or No, A, B or C, we use logistic regression.
  • 13. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why can’t we use Linear Regression? Why Not Linear Regression? Whenever the outcome of the dependent variable (Y) is discrete, like 0 or 1, Yes or No, A, B or C, we use logistic regression.
  • 14. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Y-axis X-axis 0 1 Now since our value of Y will be between 0 and 1, the linear line has to be clipped at 0 and 1. Why Not Linear Regression?
  • 15. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Y-axis X-axis 0 1 With this, our resulting curve cannot be formulated into a single formula. We needed a new way to solve this kind of problem. Hence, we came up with Logistic Regression! Why Not Linear Regression?
  • 16. www.edureka.co/data-scienceEdureka’s Data Science Certification Training 0 0.2 0.4 0.6 0.8 1 1.2 0 1 2 3 4 5 6 7 8 9 10 LOGISTIC REGRESSION The S Curve Logistic Regression Curve
  • 17. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why Logistic Regression? Equation for a straight line Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity
  • 18. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why Logistic Regression? Equation for a straight line Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity Let’s try to reduce the Logistic Regression Equation from this equation Y = C + B1X1 + B2X2 + …. In Logistic Regression Y can only be between 0 and 1.
  • 19. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why Logistic Regression? Equation for a straight line Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity Let’s try to reduce the Logistic Regression Equation from this equation Y = C + B1X1 + B2X2 + …. In Logistic Equation Y can only be between 0 and 1. Now, to get the range of Y between 0 and infinity, let’s transform Y Y 1 − Y Y=0 | 0 Y=1 | infinity Now, we have the range between 0 and infinity
  • 20. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Why Logistic Regression? Equation for a straight line Y = C + B1X1 + B2X2 + …. Range of Y is from – (infinity) to infinity Let’s try to reduce the Logistic Regression Equation from this equation Y = C + B1X1 + B2X2 + …. In Logistic Equation Y can only be between 0 and 1. Now, to get the range of Y between 0 and infinity, let’s transform Y Y 1 − Y Y=0 | 0 Y=1 | infinity Now, we have the range between 0 and infinity Let us transform it further, to get the range between –( infinity ) and infinity Y 1 − Y log 𝐘 𝟏 − 𝐘 log = C + B1X1 + B2X2 + ….
  • 21. www.edureka.co/data-scienceEdureka’s Data Science Certification Training What Is Logistic Regression?
  • 22. www.edureka.co/data-scienceEdureka’s Data Science Certification Training What Is Logistic Regression? Logistic regression, or logit regression, or logit model is a regression model where the dependent variable (DV) is categorical. DependentCategorical Variables that can have only fixed values such as A, B or C, Yes or No Y = f(X) i.e Y is dependent on X.
  • 23. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Therefore, whenever the outcome of the dependent variable (Y) is categorical, like 0 or 1, Yes or No, A, B or C, we use logistic regression. What Is Logistic Regression? 0.0 1.0
  • 24. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work?
  • 25. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Let us take an example to understand this: MODEL Selected 147, 120, 121, 128, 110, 119, 133 Not Selected 107, 89, 92, 106, 104, 114 How does Logistic Regression Work?
  • 26. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Let us take an example to understand this: MODEL Selected 147, 120, 121, 128, 110, 119, 133 Not Selected 107, 89, 92, 106, 104, 114 How does Logistic Regression Work?
  • 27. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work? Let’s take a sample dataset in R, which is called mtcars. Our aim is to predict whether a car will have a V-engine or a Straight engine based on our inputs. Mpg - Miles/US Gallon Cyl – Number of cylinders Disp – Number of cylinders Hp – Gross horsepower Drat – Rear axle ratio Wt – Weight (lb/1000) Qsec – 1/4 mile time Vs – V Engine Am – Transmission Type Gear – Number of forward gears Carb - Number of carburetors Key
  • 28. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work? For now, let’s take disp and wt as our primary independent variables. Why? We’ll be discussing it in our next section. Mpg - Miles/US Gallon Cyl – Number of cylinders Disp – Number of cylinders Hp – Gross horsepower Drat – Rear axle ratio Wt – Weight (lb/1000) Qsec – 1/4 mile time Vs – V Engine Am – Transmission Type Gear – Number of forward gears Carb - Number of carburetors Key
  • 29. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work? Since our aim is to know which engine will fit, the engine will either be V – type or not, i.e either 1 or 0. Therefore, our dependent variable is Y. Mpg - Miles/US Gallon Cyl – Number of cylinders Disp – Number of cylinders Hp – Gross horsepower Drat – Rear axle ratio Wt – Weight (lb/1000) Qsec – 1/4 mile time Vs – V Engine Am – Transmission Type Gear – Number of forward gears Carb - Number of carburetors Key
  • 30. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work? Before creating the model, we divide our dataset into training and testing. 80 % 20% Training Dataset Testing Dataset
  • 31. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work? Training to create our model and testing to validate it. 80 % Create model from this Training Dataset
  • 32. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How Does Logistic Regression Work? Once the model is created we get the following outputs, which are calculated using MLE*. 𝛽° 𝛽1 𝛽2 *Maximum Likelihood Estimation is a method of estimating the parameters.
  • 33. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Estimated Regression Equation Estimated Regression Equation: Here, β° = Constant Coefficient 𝛽1 = Coefficient of x1 𝛽2 = Coefficient of x2 𝑥1 = Independent variable 𝑥2 = Independent variable e = Euler’s Number P(Y) = Probability that Y equals 1 𝑒 𝛽 ° + 𝛽1 𝑥 1+ 𝛽2 𝑥 2 1 + 𝑒 𝛽 ° + 𝛽1 𝑥 1+ 𝛽2 𝑥 2 Logit (Y) = Y 1 − Y log =
  • 34. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Substituting Values Let’s take a value from the test dataset How Does Logistic Regression Work? 0.9849 1.9849 = = 0.4962 β° = 1.83010 β1 = 1.09428 β2 = - 0.02529 e = 2.7183 X1 = 120.3 X2 = 2.140 = 0.4962Probability of ‘vs’ being ‘1’ We will assume the threshold to be 0.5 Hence our car will not have a VS engine and hence have a straight engine. Logit (Y)
  • 35. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Substituting Values Let’s take a value from the test dataset How Does Logistic Regression Work? 0.9849 1.9849 = = 0.4962 β° = 1.83010 β1 = 1.09428 β2 = - 0.02529 e = 2.7183 X1 = 120.3 X2 = 2.140 = 0.4962Probability of ‘vs’ being ‘1’ We will assume the threshold to be 0.5 Hence our car will not have a VS engine and hence have a straight engine. Logit (Y)
  • 36. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R
  • 37. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R Key Npreg – number of pregnancies Glu – plasma glucose concentration Bp – diastolic blood pressure Skin – triceps skin fold thickness Bmi – body mass index Ped – diabetes pedigree function Age – age in years Type – 1 for yes and 0 for No for diabetic Our aim is to predict whether a patient is diabetic or not based on the following values.
  • 38. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R First, we will read the data from our CSV file, by entering this command:
  • 39. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R First, we will read the data from our CSV file, by entering this command: Then, we will split our dataset into training and testing, with the ratio 8:2
  • 40. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R First, we will read the data from our CSV file, by entering this command: Then, we will split our dataset into training and testing, with the ratio 8:2 After that we’ll create our model using the training dataset
  • 41. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R The summary of the model will give this.
  • 42. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R The summary of the model will give this. *** - 99.9% confident ** - 99% confident * - 95% confident . - 90% confident
  • 43. www.edureka.co/data-scienceEdureka’s Data Science Certification Training • This is the summary model that we get after improving our model. • So the insignificant fields is skin Logistic Regression Demo In R Null deviance shows how well the response variable is predicted by a model that includes only the intercept (grand mean) Residual deviance shows how well the response variable is predicted with inclusion of independent variables.
  • 44. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R We will the predict the values for the test dataset and then categorize them according to threshold which is 0.5
  • 45. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R We will the predict the values for the test dataset and then categorize them according to threshold which is 0.5 Create Confusion Matrix for the training dataset
  • 46. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R We will the predict the values for the test dataset and then categorize them according to threshold which is 0.5 And then finding the accuracy Create Confusion Matrix for the training dataset
  • 47. www.edureka.co/data-scienceEdureka’s Data Science Certification Training How To Find The Threshold?
  • 48. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we created. Store the predicted values for training dataset in ‘res’ variable Logistic Regression Demo In R
  • 49. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we created. Store the predicted values for training dataset in ‘res’ variable Logistic Regression Demo In R Import the library for the ROCR package
  • 50. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we created. Store the predicted values for training dataset in ‘res’ variable Logistic Regression Demo In R Import the library for the ROCR package Define the ‘ROCRPred’ and and ‘ROCRPerf’ variables
  • 51. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Let us take a sample for our significant fields and see whether our patient is diabetic or not based on the model that we created. Store the predicted values for training dataset in ‘res’ variable Logistic Regression Demo In R Import the library for the ROCR package Define the ‘ROCRPred’ and and ‘ROCRPerf’ variables Plot the graph!
  • 52. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R
  • 53. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R Confusion Matrix for Test Dataset with 0.5 threshold Confusion Matrix for Test Dataset with 0.3 threshold Accuracy = 73.8% TrueNegatives = 9 Accuracy = 67.8% TrueNegatives = 5
  • 54. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression Demo In R Confusion Matrix for Test Dataset with 0.5 threshold Confusion Matrix for Test Dataset with 0.3 threshold Accuracy = 73.8% TrueNegatives = 9 Accuracy = 67.8% TrueNegatives = 5 Confusion Matrix for Training Dataset with 0.3 threshold Accuracy = 79.4%
  • 55. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression: Use Cases
  • 56. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression – Use Case • Logistic Regression was used in conjugation with Geographic Information system in 2005, to predict the malaria breeding grounds in Africa. • Logistic regression was used to approximate areas where malaria patients would exist based on geographical inputs.
  • 57. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Logistic Regression – Use Case • Logit analysis is a statistical technique used by marketers to assess the scope of customer acceptance of a product, particularly a new product. • It attempts to determine the intensity or magnitude of customers' purchase intentions and translates that into a measure of actual buying behavior. • Many e-commerce websites assess this behavior using this model.
  • 58. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Session In A Minute The 5 Questions In Data Science Use CasesLogistic Regression Working? Logistic Regression – What & Why? Demo What Is Regression?
  • 59. www.edureka.co/data-scienceEdureka’s Data Science Certification Training Course Details Go to www.edureka.co/data-science Get Edureka Certified in Data Science Today! What our learners have to say about us! Shravan Reddy says- “I would like to recommend any one who wants to be a Data Scientist just one place: Edureka. Explanations are clean, clear, easy to understand. Their support team works very well.. I took the Data Science course and I'm going to take Machine Learning with Mahout and then Big Data and Hadoop”. Gnana Sekhar says - “Edureka Data science course provided me a very good mixture of theoretical and practical training. LMS pre recorded sessions and assignments were very good as there is a lot of information in them that will help me in my job. Edureka is my teaching GURU now...Thanks EDUREKA.” Balu Samaga says - “It was a great experience to undergo and get certified in the Data Science course from Edureka. Quality of the training materials, assignments, project, support and other infrastructures are a top notch.”