SlideShare a Scribd company logo
www.edureka.co/pythonData Science Certification Training
python
www.edureka.co/pythonData Science Certification Training
Topics Covered in Today’s Training
What is Regression?
Logistic regression: What and Why?
Linear Vs Logistic Regression
Use- Cases
Demo
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
What Is Regression
www.edureka.co/pythonData 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)
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Logistic Regression:
What And Why
www.edureka.co/pythonData Science Certification Training
Logistic Regression: What And Why?
Logistic Regression produces results in a binary format which is used to predict the outcome of a
categorical dependent variable. So the outcome should be discrete/ categorical such as:
No Code required to implement RPA
No Downtime.
24/7 up and running
Improved Accuracy
Reduced Costs
0 OR 1
Yes OR No
True OR False
High And Low
www.edureka.co/pythonData Science Certification Training
Why Not Linear Regression?
Y-axis
X-axis
0
1
Since our value of Y
will be between 0
and 1, the linear line
has to be clipped at
0 and 1.
www.edureka.co/pythonData Science Certification Training
Why Not Linear Regression?
Y-axis
X-axis
0
1
With this, our resulting
curve cannot be
formulated into a
single formula.
Hence we came up
with Logistic!
www.edureka.co/pythonData Science Certification Training
Logistic Regression Curve
The Sigmoid “S”
Curve
www.edureka.co/pythonData Science Certification Training
The Sigmoid “S”
Curve
With this, the
threshold value
indicates the
probability of winning
or losing
0.5
THRESHOLD VALUE
Logistic Regression Curve
www.edureka.co/pythonData Science Certification Training
The Logistic Regression Equation is derived from the Straight Line Equation
Logistic Regression Equation
Equation of a straight line
Y = C + BIX1 + B2X2 +…. Range is from –(infinity) to (infinity)
www.edureka.co/pythonData Science Certification Training
The Logistic Regression Equation is derived from the Straight Line Equation
Logistic Regression Equation
Equation of a straight line
Y = C + BIX1 + B2X2 +…. Range is from –(infinity) to (infinity)
Let’s try to reduce the Logistic Regression Equation from Straight Line Equation
Y = C + BIX1 + B2X2 +…. In Logistic equation Y can be only from 0 to 1
www.edureka.co/pythonData Science Certification Training
Logistic Regression Equation
Equation of a straight line
Range is from –(infinity) to (infinity)
Let’s try to reduce the Logistic Regression Equation from Straight Line Equation
In Logistic equation Y can be only from 0 to 1
Now , to get the range of Y between 0 and infinity, let’s transform Y
Now, the range is between 0 to infinity
The Logistic Regression Equation is derived from the Straight Line Equation
Y = C + BIX1 + B2X2 +….
Y = C + BIX1 + B2X2 +….
Y= 0 then 0
Y= 1 then infinity
Y
1-Y
www.edureka.co/pythonData Science Certification Training
Logistic Regression Equation
Equation of a straight line
Range is from –(infinity) to (infinity)
Let’s try to reduce the Logistic Regression Equation from Straight Line Equation
In Logistic equation Y can be only from 0 to 1
Now , to get the range of Y between 0 and infinity, let’s transform Y
Now, the range is between 0 to infinity
Let us transform it further, to get range between –(infinity) and (infinity)
log Y
1-Y
Y = C + BIX1 + B2X2 +…. Final Logistic Regression Equation
The Logistic Regression Equation is derived from the Straight Line Equation
Y = C + BIX1 + B2X2 +….
Y = C + BIX1 + B2X2 +….
Y= 0 then 0
Y= 1 then infinity
Y
1-Y
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Linear
Logistic
www.edureka.co/pythonData Science Certification Training
Linear Vs Logistic Regression
Linear Regression Logistic Regression
Continuous variables1
Solves Regression Problems2
Straight line3
Categorical variables1
Solves Classification Problems2
S-Curve3
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Logistic Regression:
Use - Cases
www.edureka.co/pythonData Science Certification Training
Logistic Regression: Use - Cases
Weather
Predictions
www.edureka.co/pythonData Science Certification Training
Logistic Regression: Use - Cases
Classification
Problems
www.edureka.co/pythonData Science Certification Training
Logistic Regression: Use - Cases
Determines
Illness
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Demo
www.edureka.co/pythonData Science Certification Training
1
Titanic Data Analysis
Explore titanic dataset and explore about the people, both those who survived and those who did
not. With today's technology, answering questions through data analysis is now easier than ever.
1
What factors made people more likely to
survive the sinking of the Titanic?
www.edureka.co/pythonData Science Certification Training
Titanic Dataset
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
Analyzing Data
1
2
3
4
5
Collecting Data
Train & Test
Data Wrangling
Accuracy Check
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
1
2
3
4
5
Collect Data: Import Libraries
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
1
2
3
4
5
Analyzing Data
Creating different plot to check
relationship between variables
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
1
2
3
4
5
Analyzing Data
Creating different plot to check
relationship between variables
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
1
2
3
4
5
Data Wrangling
Clean the data by removing
the Nan values and
unnecessary columns in the
dataset
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
1
2
3
4
5
Train & Test Data
Build the model on the train
data and predict the output on
the test data
logistic = LogisticRegression()
logistic.fit(train_X,train_Y)
www.edureka.co/pythonData Science Certification Training
Implement Logistic Regression
1
2
3
4
5
Accuracy Check
Calculate accuracy to check how
accurate your results are.
from sklearn.metrics import accuracy_score
accuracy_score(y_test,predictions)*100
www.edureka.co/pythonData Science Certification Training
SUV Data Analysis
What factors made people more
interested in buying SUV?
1 A car company has released a new SUV in the market. Using the previous data about the sales of their
SUV’s, they want to predict the category of people who might be interested in buying this.
2
www.edureka.co/pythonData Science Certification Training
SUV Predictions
www.edureka.co/pythonData Science Certification Training
Session in a Minute
What is regression? Logistic: What & Why?
Use - Cases
Linear VS Logistic
Demo2: SUV PredictionDemo1: Titanic Analysis
No Code required
to implement RPA
No Downtime.
24/7 up and running
Improved Accuracy
Reduced Costs
0 And 1
Yes And No
True And False
High And Low
Linear Regression Logistic Regression
Continuous variables1
Solves Regression Problems2
Straight line Curve3
Categorical variables1
Solves Classification Problems2
S-Curve3
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Don’t just learn it, MASTER it with
Logistic Regression in Python | Logistic Regression Example | Machine Learning Algorithms | Edureka

More Related Content

What's hot (20)

Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Edureka!
 
Decision Tree - C4.5&CART
Decision Tree - C4.5&CARTDecision Tree - C4.5&CART
Decision Tree - C4.5&CART
Xueping Peng
 
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
Data Science Full Course | Edureka
Data Science Full Course | EdurekaData Science Full Course | Edureka
Data Science Full Course | Edureka
Edureka!
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
Functional Imperative
 
K Nearest Neighbor Algorithm
K Nearest Neighbor AlgorithmK Nearest Neighbor Algorithm
K Nearest Neighbor Algorithm
Tharuka Vishwajith Sarathchandra
 
Naive Bayes
Naive BayesNaive Bayes
Naive Bayes
CloudxLab
 
Random forest
Random forestRandom forest
Random forest
Ujjawal
 
Logistic regression in Machine Learning
Logistic regression in Machine LearningLogistic regression in Machine Learning
Logistic regression in Machine Learning
Kuppusamy P
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
Mohammad Junaid Khan
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear Regression
Andrew Ferlitsch
 
Linear regression
Linear regressionLinear regression
Linear regression
MartinHogg9
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
kishanthkumaar
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
Venkata Reddy Konasani
 
Naive Bayes Presentation
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes Presentation
Md. Enamul Haque Chowdhury
 
supervised learning
supervised learningsupervised learning
supervised learning
Amar Tripathi
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
Tonmoy Bhagawati
 
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Simplilearn
 
Linear regression in machine learning
Linear regression in machine learningLinear regression in machine learning
Linear regression in machine learning
Shajun Nisha
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)
Abhimanyu Dwivedi
 
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Edureka!
 
Decision Tree - C4.5&CART
Decision Tree - C4.5&CARTDecision Tree - C4.5&CART
Decision Tree - C4.5&CART
Xueping Peng
 
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
Data Science Full Course | Edureka
Data Science Full Course | EdurekaData Science Full Course | Edureka
Data Science Full Course | Edureka
Edureka!
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
Functional Imperative
 
Random forest
Random forestRandom forest
Random forest
Ujjawal
 
Logistic regression in Machine Learning
Logistic regression in Machine LearningLogistic regression in Machine Learning
Logistic regression in Machine Learning
Kuppusamy P
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear Regression
Andrew Ferlitsch
 
Linear regression
Linear regressionLinear regression
Linear regression
MartinHogg9
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
kishanthkumaar
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
Tonmoy Bhagawati
 
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Simplilearn
 
Linear regression in machine learning
Linear regression in machine learningLinear regression in machine learning
Linear regression in machine learning
Shajun Nisha
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)
Abhimanyu Dwivedi
 

Similar to Logistic Regression in Python | Logistic Regression Example | Machine Learning Algorithms | Edureka (20)

Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...
Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...
Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...
Edureka!
 
Logistic Regression.pptx
Logistic Regression.pptxLogistic Regression.pptx
Logistic Regression.pptx
Muskaan194530
 
Logistic regression.ppt
Logistic regression.pptLogistic regression.ppt
Logistic regression.ppt
BalaChowdappa1
 
Logistic Regression in machine learning ppt
Logistic Regression in machine learning pptLogistic Regression in machine learning ppt
Logistic Regression in machine learning ppt
raminder12_kaur
 
Logistic Regression: Behind the Scenes
Logistic Regression: Behind the ScenesLogistic Regression: Behind the Scenes
Logistic Regression: Behind the Scenes
Chris White
 
3ml.pdf
3ml.pdf3ml.pdf
3ml.pdf
MianAdnan27
 
Logistics Regression Using Python.pptx
Logistics Regression Using Python.pptxLogistics Regression Using Python.pptx
Logistics Regression Using Python.pptx
SharmilaMore5
 
logisticregression-190726150723.pdf
logisticregression-190726150723.pdflogisticregression-190726150723.pdf
logisticregression-190726150723.pdf
SuaibDanish
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
Rupak Roy
 
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
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
ajondaree
 
Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms
Learnbay Datascience
 
Lecture 3.1_ Logistic Regression powerpoint
Lecture 3.1_ Logistic Regression powerpointLecture 3.1_ Logistic Regression powerpoint
Lecture 3.1_ Logistic Regression powerpoint
zahidwadiwale
 
Machine_Learning.pptx
Machine_Learning.pptxMachine_Learning.pptx
Machine_Learning.pptx
VickyKumar131533
 
MACHINE LEARNING Unit -2 Algorithm.pptx
MACHINE LEARNING Unit  -2 Algorithm.pptxMACHINE LEARNING Unit  -2 Algorithm.pptx
MACHINE LEARNING Unit -2 Algorithm.pptx
ARVIND SARDAR
 
Supervised Machine Learning Algorithms
Supervised Machine Learning   AlgorithmsSupervised Machine Learning   Algorithms
Supervised Machine Learning Algorithms
engrfarhanhanif
 
Logistical Regression.pptx
Logistical Regression.pptxLogistical Regression.pptx
Logistical Regression.pptx
Ramakrishna Reddy Bijjam
 
Machine Learning Algorithm - Logistic Regression
Machine Learning Algorithm - Logistic RegressionMachine Learning Algorithm - Logistic Regression
Machine Learning Algorithm - Logistic Regression
Kush Kulshrestha
 
Group 20_Logistic Regression devara.pptx
Group 20_Logistic Regression devara.pptxGroup 20_Logistic Regression devara.pptx
Group 20_Logistic Regression devara.pptx
sriaditya070304
 
Logistic regression in_python_tutorial
Logistic regression in_python_tutorialLogistic regression in_python_tutorial
Logistic regression in_python_tutorial
SALWAidrissiakhannou
 
Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...
Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...
Logistic Regression in R | Machine Learning Algorithms | Data Science Trainin...
Edureka!
 
Logistic Regression.pptx
Logistic Regression.pptxLogistic Regression.pptx
Logistic Regression.pptx
Muskaan194530
 
Logistic regression.ppt
Logistic regression.pptLogistic regression.ppt
Logistic regression.ppt
BalaChowdappa1
 
Logistic Regression in machine learning ppt
Logistic Regression in machine learning pptLogistic Regression in machine learning ppt
Logistic Regression in machine learning ppt
raminder12_kaur
 
Logistic Regression: Behind the Scenes
Logistic Regression: Behind the ScenesLogistic Regression: Behind the Scenes
Logistic Regression: Behind the Scenes
Chris White
 
Logistics Regression Using Python.pptx
Logistics Regression Using Python.pptxLogistics Regression Using Python.pptx
Logistics Regression Using Python.pptx
SharmilaMore5
 
logisticregression-190726150723.pdf
logisticregression-190726150723.pdflogisticregression-190726150723.pdf
logisticregression-190726150723.pdf
SuaibDanish
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
Rupak Roy
 
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
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
ajondaree
 
Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms Logistic regression, machine learning algorithms
Logistic regression, machine learning algorithms
Learnbay Datascience
 
Lecture 3.1_ Logistic Regression powerpoint
Lecture 3.1_ Logistic Regression powerpointLecture 3.1_ Logistic Regression powerpoint
Lecture 3.1_ Logistic Regression powerpoint
zahidwadiwale
 
MACHINE LEARNING Unit -2 Algorithm.pptx
MACHINE LEARNING Unit  -2 Algorithm.pptxMACHINE LEARNING Unit  -2 Algorithm.pptx
MACHINE LEARNING Unit -2 Algorithm.pptx
ARVIND SARDAR
 
Supervised Machine Learning Algorithms
Supervised Machine Learning   AlgorithmsSupervised Machine Learning   Algorithms
Supervised Machine Learning Algorithms
engrfarhanhanif
 
Machine Learning Algorithm - Logistic Regression
Machine Learning Algorithm - Logistic RegressionMachine Learning Algorithm - Logistic Regression
Machine Learning Algorithm - Logistic Regression
Kush Kulshrestha
 
Group 20_Logistic Regression devara.pptx
Group 20_Logistic Regression devara.pptxGroup 20_Logistic Regression devara.pptx
Group 20_Logistic Regression devara.pptx
sriaditya070304
 
Logistic regression in_python_tutorial
Logistic regression in_python_tutorialLogistic regression in_python_tutorial
Logistic regression in_python_tutorial
SALWAidrissiakhannou
 
Ad

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
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!
 
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!
 
Ad

Recently uploaded (20)

Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 

Logistic Regression in Python | Logistic Regression Example | Machine Learning Algorithms | Edureka

  • 2. www.edureka.co/pythonData Science Certification Training Topics Covered in Today’s Training What is Regression? Logistic regression: What and Why? Linear Vs Logistic Regression Use- Cases Demo
  • 3. Copyright © 2018, edureka and/or its affiliates. All rights reserved. What Is Regression
  • 4. www.edureka.co/pythonData 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)
  • 5. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Logistic Regression: What And Why
  • 6. www.edureka.co/pythonData Science Certification Training Logistic Regression: What And Why? Logistic Regression produces results in a binary format which is used to predict the outcome of a categorical dependent variable. So the outcome should be discrete/ categorical such as: No Code required to implement RPA No Downtime. 24/7 up and running Improved Accuracy Reduced Costs 0 OR 1 Yes OR No True OR False High And Low
  • 7. www.edureka.co/pythonData Science Certification Training Why Not Linear Regression? Y-axis X-axis 0 1 Since our value of Y will be between 0 and 1, the linear line has to be clipped at 0 and 1.
  • 8. www.edureka.co/pythonData Science Certification Training Why Not Linear Regression? Y-axis X-axis 0 1 With this, our resulting curve cannot be formulated into a single formula. Hence we came up with Logistic!
  • 9. www.edureka.co/pythonData Science Certification Training Logistic Regression Curve The Sigmoid “S” Curve
  • 10. www.edureka.co/pythonData Science Certification Training The Sigmoid “S” Curve With this, the threshold value indicates the probability of winning or losing 0.5 THRESHOLD VALUE Logistic Regression Curve
  • 11. www.edureka.co/pythonData Science Certification Training The Logistic Regression Equation is derived from the Straight Line Equation Logistic Regression Equation Equation of a straight line Y = C + BIX1 + B2X2 +…. Range is from –(infinity) to (infinity)
  • 12. www.edureka.co/pythonData Science Certification Training The Logistic Regression Equation is derived from the Straight Line Equation Logistic Regression Equation Equation of a straight line Y = C + BIX1 + B2X2 +…. Range is from –(infinity) to (infinity) Let’s try to reduce the Logistic Regression Equation from Straight Line Equation Y = C + BIX1 + B2X2 +…. In Logistic equation Y can be only from 0 to 1
  • 13. www.edureka.co/pythonData Science Certification Training Logistic Regression Equation Equation of a straight line Range is from –(infinity) to (infinity) Let’s try to reduce the Logistic Regression Equation from Straight Line Equation In Logistic equation Y can be only from 0 to 1 Now , to get the range of Y between 0 and infinity, let’s transform Y Now, the range is between 0 to infinity The Logistic Regression Equation is derived from the Straight Line Equation Y = C + BIX1 + B2X2 +…. Y = C + BIX1 + B2X2 +…. Y= 0 then 0 Y= 1 then infinity Y 1-Y
  • 14. www.edureka.co/pythonData Science Certification Training Logistic Regression Equation Equation of a straight line Range is from –(infinity) to (infinity) Let’s try to reduce the Logistic Regression Equation from Straight Line Equation In Logistic equation Y can be only from 0 to 1 Now , to get the range of Y between 0 and infinity, let’s transform Y Now, the range is between 0 to infinity Let us transform it further, to get range between –(infinity) and (infinity) log Y 1-Y Y = C + BIX1 + B2X2 +…. Final Logistic Regression Equation The Logistic Regression Equation is derived from the Straight Line Equation Y = C + BIX1 + B2X2 +…. Y = C + BIX1 + B2X2 +…. Y= 0 then 0 Y= 1 then infinity Y 1-Y
  • 15. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Linear Logistic
  • 16. www.edureka.co/pythonData Science Certification Training Linear Vs Logistic Regression Linear Regression Logistic Regression Continuous variables1 Solves Regression Problems2 Straight line3 Categorical variables1 Solves Classification Problems2 S-Curve3
  • 17. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Logistic Regression: Use - Cases
  • 18. www.edureka.co/pythonData Science Certification Training Logistic Regression: Use - Cases Weather Predictions
  • 19. www.edureka.co/pythonData Science Certification Training Logistic Regression: Use - Cases Classification Problems
  • 20. www.edureka.co/pythonData Science Certification Training Logistic Regression: Use - Cases Determines Illness
  • 21. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Demo
  • 22. www.edureka.co/pythonData Science Certification Training 1 Titanic Data Analysis Explore titanic dataset and explore about the people, both those who survived and those who did not. With today's technology, answering questions through data analysis is now easier than ever. 1 What factors made people more likely to survive the sinking of the Titanic?
  • 24. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression Analyzing Data 1 2 3 4 5 Collecting Data Train & Test Data Wrangling Accuracy Check
  • 25. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression 1 2 3 4 5 Collect Data: Import Libraries
  • 26. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression 1 2 3 4 5 Analyzing Data Creating different plot to check relationship between variables
  • 27. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression 1 2 3 4 5 Analyzing Data Creating different plot to check relationship between variables
  • 28. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression 1 2 3 4 5 Data Wrangling Clean the data by removing the Nan values and unnecessary columns in the dataset
  • 29. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression 1 2 3 4 5 Train & Test Data Build the model on the train data and predict the output on the test data logistic = LogisticRegression() logistic.fit(train_X,train_Y)
  • 30. www.edureka.co/pythonData Science Certification Training Implement Logistic Regression 1 2 3 4 5 Accuracy Check Calculate accuracy to check how accurate your results are. from sklearn.metrics import accuracy_score accuracy_score(y_test,predictions)*100
  • 31. www.edureka.co/pythonData Science Certification Training SUV Data Analysis What factors made people more interested in buying SUV? 1 A car company has released a new SUV in the market. Using the previous data about the sales of their SUV’s, they want to predict the category of people who might be interested in buying this. 2
  • 33. www.edureka.co/pythonData Science Certification Training Session in a Minute What is regression? Logistic: What & Why? Use - Cases Linear VS Logistic Demo2: SUV PredictionDemo1: Titanic Analysis No Code required to implement RPA No Downtime. 24/7 up and running Improved Accuracy Reduced Costs 0 And 1 Yes And No True And False High And Low Linear Regression Logistic Regression Continuous variables1 Solves Regression Problems2 Straight line Curve3 Categorical variables1 Solves Classification Problems2 S-Curve3
  • 34. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Don’t just learn it, MASTER it with