SlideShare a Scribd company logo
Lesson 12
Machine Learning – Logistic Regression Kush Kulshrestha
Introduction
• One of the most simple algorithm used for 2 class classification problem.
• Logistic Regression can be used for various classification problems such as spam detection. Diabetes prediction, if
a given customer will purchase a particular product or will they churn another competitor, whether the user will
click on a given advertisement link or not.
• Just like Linear Regression uses optimize Least Square function to calculate the coefficients, Logistic Regression
uses Log Likelihood function to find the value of the best fit parameters.
• Logistic Regression is the basic algorithm used to define a Neural Network.
Sigmoid Function Refresher
The logistic function or a Sigmoid function is a function which takes any real value between zero and one. It is
defined as
y = 1 / (1 + e-x)
where y is the scaled value and x is the input value.
The logistic function transforms the original range of [-,] to [0,1] and also has a linear part on the transform.
Probability, Odds and Log odds
Probability of an event = (No of Success / Total no of cases)
Odds = (One outcome / all other outcomes)
Examples: Conversion:
• For rolling a dice and getting 1 –
Probability = (1/6)
Odds = (1/5)
• Rolling a dice and getting an even number –
Probability = (3/6) = 0.5
Odds = (3/3) = 1
• Dice roll less than 5 –
Probability = (4/6) = (2/3)
Odds = (4/2) = 2
What is Logistic Regression
Linear regression is continuous response is modelled as a linear combination of the features.
In Logistic regression, log-odds of a categorical response being "true" (1) is modelled as a linear combination of the
features. This is called the logit function.
The equation can be rearranged into the logistic function:
p =
Conclusion –
• Logistic regression outputs the probabilities of a specific class.
• Those probabilities can be converted into class predictions.
• The logistic function takes on an "s" shape and is bounded by 0 and 1.
Interpreting Logistic Regression Coefficients
Final equation of Logistic regression is:
Interpreting beta:
‘1’ unit increase in ‘x' is associated with a B1 unit increase in the log-odds of event for which p is probability of.
Log odds are:
Hence, positive coefficients increase the log-odds of the response (and thus increase the probability), and negative
coefficients decrease the log-odds of the response (and thus decrease the probability).
Machine Learning Algorithm - Logistic Regression
Machine Learning Algorithm - Logistic Regression
Machine Learning Algorithm - Logistic Regression

More Related Content

What's hot (20)

PPTX
Data mining: Classification and prediction
DataminingTools Inc
 
ODP
Machine Learning With Logistic Regression
Knoldus Inc.
 
PDF
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Edureka!
 
PPTX
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Md. Main Uddin Rony
 
PPTX
Machine Learning: Bias and Variance Trade-off
International Institute of Information Technology (I²IT)
 
PDF
Nonlinear component analysis as a kernel eigenvalue problem
Michele Filannino
 
PDF
Cluster analysis
Hohai university
 
PPTX
The world of loss function
홍배 김
 
PPTX
Data preprocessing in Machine learning
pyingkodi maran
 
PPTX
Overfitting & Underfitting
SOUMIT KAR
 
PPTX
Fractional knapsack class 13
Kumar
 
PDF
Confusion Matrix Explained
Stockholm University
 
PDF
Linear regression
MartinHogg9
 
PDF
Convolutional Neural Networks : Popular Architectures
ananth
 
PPTX
Linear regression in machine learning
Shajun Nisha
 
PPTX
Gradient descent method
Prof. Neeta Awasthy
 
PPTX
Machine Learning lecture6(regularization)
cairo university
 
PDF
Hill climbing algorithm in artificial intelligence
sandeep54552
 
PDF
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Derek Kane
 
PPTX
PCA and LDA in machine learning
Akhilesh Joshi
 
Data mining: Classification and prediction
DataminingTools Inc
 
Machine Learning With Logistic Regression
Knoldus Inc.
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Edureka!
 
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Md. Main Uddin Rony
 
Machine Learning: Bias and Variance Trade-off
International Institute of Information Technology (I²IT)
 
Nonlinear component analysis as a kernel eigenvalue problem
Michele Filannino
 
Cluster analysis
Hohai university
 
The world of loss function
홍배 김
 
Data preprocessing in Machine learning
pyingkodi maran
 
Overfitting & Underfitting
SOUMIT KAR
 
Fractional knapsack class 13
Kumar
 
Confusion Matrix Explained
Stockholm University
 
Linear regression
MartinHogg9
 
Convolutional Neural Networks : Popular Architectures
ananth
 
Linear regression in machine learning
Shajun Nisha
 
Gradient descent method
Prof. Neeta Awasthy
 
Machine Learning lecture6(regularization)
cairo university
 
Hill climbing algorithm in artificial intelligence
sandeep54552
 
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Derek Kane
 
PCA and LDA in machine learning
Akhilesh Joshi
 

Similar to Machine Learning Algorithm - Logistic Regression (20)

PPTX
Logistic Regression in machine learning ppt
raminder12_kaur
 
PPTX
Linear Regression and Logistic Regression in ML
Kumud Arora
 
PPTX
Group 20_Logistic Regression devara.pptx
sriaditya070304
 
PPT
Logistic regression.ppt
BalaChowdappa1
 
PDF
Logistic regression, machine learning algorithms
Learnbay Datascience
 
PDF
Machine Learning-Lec5.pdf_explain of logistic regression
BeshoyArnest
 
PPTX
Interpretation of coefficients Linear and Logistic regression
Ankit Sharma
 
PDF
3ml.pdf
MianAdnan27
 
PPTX
LOGISTIC_REGRESSION for AI and ML Beginners
DebdattaBhattacharya1
 
PPTX
Supervised Machine Learning Algorithms
engrfarhanhanif
 
PDF
Logistic regression
Rupak Roy
 
PPTX
Logistical Regression.pptx
Ramakrishna Reddy Bijjam
 
PPTX
lec+5+_part+1 cloud .pptx
samaghorab
 
PPTX
logistic regression in Data science Presentation
ARUN R S
 
PDF
Logistic RegressionwithMathematicalExamplesonit.pdf
ansarinazish958
 
PPTX
Logistic regression with SPSS examples
Gaurav Kamboj
 
PDF
Logistic Regression Classifier - Conceptual Guide
Caglar Subasi
 
PPTX
lrssssssss7777 s jsjs jssssssjs m.pptx
SAnjayKumar3129
 
PDF
logisticregression-190726150723.pdf
SuaibDanish
 
PDF
Logistic Regression : classification algorithm
habibaabderrahim1
 
Logistic Regression in machine learning ppt
raminder12_kaur
 
Linear Regression and Logistic Regression in ML
Kumud Arora
 
Group 20_Logistic Regression devara.pptx
sriaditya070304
 
Logistic regression.ppt
BalaChowdappa1
 
Logistic regression, machine learning algorithms
Learnbay Datascience
 
Machine Learning-Lec5.pdf_explain of logistic regression
BeshoyArnest
 
Interpretation of coefficients Linear and Logistic regression
Ankit Sharma
 
3ml.pdf
MianAdnan27
 
LOGISTIC_REGRESSION for AI and ML Beginners
DebdattaBhattacharya1
 
Supervised Machine Learning Algorithms
engrfarhanhanif
 
Logistic regression
Rupak Roy
 
Logistical Regression.pptx
Ramakrishna Reddy Bijjam
 
lec+5+_part+1 cloud .pptx
samaghorab
 
logistic regression in Data science Presentation
ARUN R S
 
Logistic RegressionwithMathematicalExamplesonit.pdf
ansarinazish958
 
Logistic regression with SPSS examples
Gaurav Kamboj
 
Logistic Regression Classifier - Conceptual Guide
Caglar Subasi
 
lrssssssss7777 s jsjs jssssssjs m.pptx
SAnjayKumar3129
 
logisticregression-190726150723.pdf
SuaibDanish
 
Logistic Regression : classification algorithm
habibaabderrahim1
 
Ad

More from Kush Kulshrestha (17)

PDF
Clustering - Machine Learning Techniques
Kush Kulshrestha
 
PDF
Machine Learning Algorithm - KNN
Kush Kulshrestha
 
PDF
Machine Learning Algorithm - Decision Trees
Kush Kulshrestha
 
PDF
Machine Learning Algorithm - Naive Bayes for Classification
Kush Kulshrestha
 
PDF
Assumptions of Linear Regression - Machine Learning
Kush Kulshrestha
 
PDF
Interpreting Regression Results - Machine Learning
Kush Kulshrestha
 
PDF
Machine Learning Algorithm - Linear Regression
Kush Kulshrestha
 
PDF
General Concepts of Machine Learning
Kush Kulshrestha
 
PDF
Performance Metrics for Machine Learning Algorithms
Kush Kulshrestha
 
PDF
Visualization-2
Kush Kulshrestha
 
PDF
Visualization-1
Kush Kulshrestha
 
PDF
Inferential Statistics
Kush Kulshrestha
 
PDF
Descriptive Statistics
Kush Kulshrestha
 
PDF
Scaling and Normalization
Kush Kulshrestha
 
PPTX
Wireless Charging of Electric Vehicles
Kush Kulshrestha
 
PPTX
Time management
Kush Kulshrestha
 
PPTX
Handshakes and their types
Kush Kulshrestha
 
Clustering - Machine Learning Techniques
Kush Kulshrestha
 
Machine Learning Algorithm - KNN
Kush Kulshrestha
 
Machine Learning Algorithm - Decision Trees
Kush Kulshrestha
 
Machine Learning Algorithm - Naive Bayes for Classification
Kush Kulshrestha
 
Assumptions of Linear Regression - Machine Learning
Kush Kulshrestha
 
Interpreting Regression Results - Machine Learning
Kush Kulshrestha
 
Machine Learning Algorithm - Linear Regression
Kush Kulshrestha
 
General Concepts of Machine Learning
Kush Kulshrestha
 
Performance Metrics for Machine Learning Algorithms
Kush Kulshrestha
 
Visualization-2
Kush Kulshrestha
 
Visualization-1
Kush Kulshrestha
 
Inferential Statistics
Kush Kulshrestha
 
Descriptive Statistics
Kush Kulshrestha
 
Scaling and Normalization
Kush Kulshrestha
 
Wireless Charging of Electric Vehicles
Kush Kulshrestha
 
Time management
Kush Kulshrestha
 
Handshakes and their types
Kush Kulshrestha
 
Ad

Recently uploaded (20)

PDF
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
PDF
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
PPTX
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
PPTX
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
PDF
SQL for Accountants and Finance Managers
ysmaelreyes
 
PPTX
办理学历认证InformaticsLetter新加坡英华美学院毕业证书,Informatics成绩单
Taqyea
 
PDF
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
PDF
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
PDF
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
PDF
apidays Singapore 2025 - Building a Federated Future, Alex Szomora (GSMA)
apidays
 
PPTX
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
PPTX
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
PPTX
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PPTX
BinarySearchTree in datastructures in detail
kichokuttu
 
PPTX
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
PPTX
在线购买英国本科毕业证苏格兰皇家音乐学院水印成绩单RSAMD学费发票
Taqyea
 
PDF
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
PDF
Data Science Course Certificate by Sigma Software University
Stepan Kalika
 
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
SQL for Accountants and Finance Managers
ysmaelreyes
 
办理学历认证InformaticsLetter新加坡英华美学院毕业证书,Informatics成绩单
Taqyea
 
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
apidays Singapore 2025 - Building a Federated Future, Alex Szomora (GSMA)
apidays
 
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
BinarySearchTree in datastructures in detail
kichokuttu
 
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
在线购买英国本科毕业证苏格兰皇家音乐学院水印成绩单RSAMD学费发票
Taqyea
 
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
Data Science Course Certificate by Sigma Software University
Stepan Kalika
 

Machine Learning Algorithm - Logistic Regression

  • 1. Lesson 12 Machine Learning – Logistic Regression Kush Kulshrestha
  • 2. Introduction • One of the most simple algorithm used for 2 class classification problem. • Logistic Regression can be used for various classification problems such as spam detection. Diabetes prediction, if a given customer will purchase a particular product or will they churn another competitor, whether the user will click on a given advertisement link or not. • Just like Linear Regression uses optimize Least Square function to calculate the coefficients, Logistic Regression uses Log Likelihood function to find the value of the best fit parameters. • Logistic Regression is the basic algorithm used to define a Neural Network.
  • 3. Sigmoid Function Refresher The logistic function or a Sigmoid function is a function which takes any real value between zero and one. It is defined as y = 1 / (1 + e-x) where y is the scaled value and x is the input value. The logistic function transforms the original range of [-,] to [0,1] and also has a linear part on the transform.
  • 4. Probability, Odds and Log odds Probability of an event = (No of Success / Total no of cases) Odds = (One outcome / all other outcomes) Examples: Conversion: • For rolling a dice and getting 1 – Probability = (1/6) Odds = (1/5) • Rolling a dice and getting an even number – Probability = (3/6) = 0.5 Odds = (3/3) = 1 • Dice roll less than 5 – Probability = (4/6) = (2/3) Odds = (4/2) = 2
  • 5. What is Logistic Regression Linear regression is continuous response is modelled as a linear combination of the features. In Logistic regression, log-odds of a categorical response being "true" (1) is modelled as a linear combination of the features. This is called the logit function. The equation can be rearranged into the logistic function: p = Conclusion – • Logistic regression outputs the probabilities of a specific class. • Those probabilities can be converted into class predictions. • The logistic function takes on an "s" shape and is bounded by 0 and 1.
  • 6. Interpreting Logistic Regression Coefficients Final equation of Logistic regression is: Interpreting beta: ‘1’ unit increase in ‘x' is associated with a B1 unit increase in the log-odds of event for which p is probability of. Log odds are: Hence, positive coefficients increase the log-odds of the response (and thus increase the probability), and negative coefficients decrease the log-odds of the response (and thus decrease the probability).