SlideShare a Scribd company logo
1 of 23
Logistic Regression
Harsh Asawa
201EE222
What is Logistic Regression?
 Logistic Regression is a supervised algorithm for binary and
multi-class classification tasks.
 It is a widely used method for predicting the probability of an
instance belonging to a specific class instead of simple binary
prediction.
 Logistic Regression accepts independent variables as input and
predicts the categorical outcome of the dependent variable.
Independent Variables
 These are the input variables and are also known as features or
predictors.
 The model takes these as input and makes predictions about the
probability of an instance belonging to a category.
 E.g.- For predicting heart disease, independent variables will be
Age, Cholesterol Level, Blood Pressure etc.
Dependent Variables
 These are outcome or target variables that are predicted based
on features(independent variables).
 These are categorical variables for which we estimate the
probability of certain categories.
 E.g.- For heart disease prediction, the dependent variable will be
1 (have heart disease) or 0 (does not have).
How it is different from Linear
Regression?
Linear Regression
 Linear Regression is used
for predicting continuous
numeric values.
 It models the relationship
between independent
variables and a dependent
variable by fitting a linear
equation.
Logistic Regression
 Logistic Regression is used
for binary classification tasks.
 It predicts the probability of
an instance belonging to a
specific class.
Linear Regression
 The output of Linear
Regression is a continuous
numerical value.
 It is suitable for problems
where the dependent
variable is numeric. E.g.- For
predicting Stock prices,
Housing prices, Air Quality
prediction etc.
Logistic Regression
 The output of Logistic
Regression is a probability
value between 0 and 1 that
represents the probability of
belonging to a particular
class.
 It is suitable for binary
classification. E.g.- Predicting
medical conditions, Churn
Prediction, Spam detection
etc.
Model Components
 Input Features(X)
These are the independent variables or features that describe
the data instances we work with.
 Weights(θ)
Weights refer to the coefficients assigned to each independent
variable (feature) in the linear combination that is used to make
predictions. These weights determine the influence of each feature
on the final prediction.
 Bias(θ₀)
In Logistic Regression “Bias” refers to the intercept term in the
linear equation. It allows the linear model to make predictions even
when all input features are zero.
Here, z is the linear combination
θ₀(represented as b) is bias
w is the weight associated with each feature
 Sigmoid Function (Logistic function)
The sigmoid function is a crucial component that transforms the
linear combination of input features and their associated weights
into a probability value.
If the output of the sigmoid function is greater than or equal to
Decision Boundary (generally 0.5), the instance is predicted to
belong to the positive class otherwise to the negative class.
P(y = 1|X) =
Sigmoid Function Curve
Cost Function
 A cost function (also known as a loss function) is a measure that
quantifies the discrepancy between the predicted values of a
model and the actual values.
 The goal is to minimize this loss function during model training to
achieve accurate predictions.
 In the case of Logistic Regression, the cost function is often the
log loss or cross-entropy loss.
 During model training, optimization algorithms like gradient
descent are used to iteratively update the model parameters(θ)
to minimize the log loss function.
Log Loss Function
Optimization Techniques
Regularization
 Regularization is a technique used in machine learning to prevent
overfitting and improve the generalization ability of a model.
 Regularization is particularly useful when dealing with complex
models that have a high number of features or parameters.
 L1-Regularization(Lasso)
 L2-Regularization(Ridge)
Gradient Descent
 Gradient descent is an iterative optimization algorithm that
updates the model's parameters in the opposite direction of the
gradient of the cost function.
 Gradient descent takes steps in the parameter space that lead to
lower values of the cost function.
Model Evaluation
 Accuracy
Accuracy is the ratio of correctly predicted instances to the total
number of instances in the testing set.
 Precision
Precision measures the proportion of correctly predicted positive
instances out of all instances predicted as positive.
 Recall(Sensitivity)
Recall measures the proportion of correctly predicted positive
instances out of all actual positive instances.
 F1-Score
The F1-score is the harmonic mean of precision and recall, providing
a balanced measure of the model's accuracy.
 Receiver Operating Characteristic (ROC) Curve
 It is a graphical representation that shows the performance of a
classification model across different levels of decision
thresholds.
 It plots the true positive rate (recall) against the false positive
rate at various threshold settings, providing valuable insights into
the model's ability to distinguish between positive and negative
classes.
Applications
 Medical Diagnosis and Healthcare
 Market and Consumer Analysis
 Image and Object Recognition
 Fraud Detection
 Social Sciences and Political Analysis
 Natural Language Processing (NLP)
Advantages and Limitations
 Advantages
 Logistic regression is computationally efficient and can handle
relatively large datasets with ease.
 Compared to more complex models, logistic regression has
a lower risk of overfitting.
 Logistic regression is specifically designed for binary
classification problems.
 Logistic regression can help identify important features that have
a significant impact on the outcome.
 Limitations
 When dealing with high-dimensional data, logistic regression can
become prone to overfitting.
 Logistic regression is inherently designed for binary classification
problems. So multi-class problems might not be as
straightforward to interpret.
 Logistic regression is sensitive to outliers, especially if the dataset
is small.
 Logistic regression requires complete data for all variables.
Dealing with missing data can be challenging.
 When dealing with imbalanced datasets (where one class is
much more frequent than the other), logistic regression might
struggle to predict the minority class effectively.
Thank You

More Related Content

Similar to Logistic Regression power point presentation.pptx

Logistic Regression in machine learning.docx
Logistic Regression in machine learning.docxLogistic Regression in machine learning.docx
Logistic Regression in machine learning.docxAbhaBansal8
 
NPTL Machine Learning Week 2.docx
NPTL Machine Learning Week 2.docxNPTL Machine Learning Week 2.docx
NPTL Machine Learning Week 2.docxMr. Moms
 
Logistic Regression.pptx
Logistic Regression.pptxLogistic Regression.pptx
Logistic Regression.pptxMuskaan194530
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spssDr Nisha Arora
 
Predicting Employee Attrition
Predicting Employee AttritionPredicting Employee Attrition
Predicting Employee AttritionShruti Mohan
 
Logistic regression - one of the key regression tools in experimental research
Logistic regression - one of the key regression tools in experimental researchLogistic regression - one of the key regression tools in experimental research
Logistic regression - one of the key regression tools in experimental researchAdrian Olszewski
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)Abhimanyu Dwivedi
 
Data Science - Part IV - Regression Analysis & ANOVA
Data Science - Part IV - Regression Analysis & ANOVAData Science - Part IV - Regression Analysis & ANOVA
Data Science - Part IV - Regression Analysis & ANOVADerek Kane
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regressionkishanthkumaar
 
2018 p 2019-ee-a2
2018 p 2019-ee-a22018 p 2019-ee-a2
2018 p 2019-ee-a2uetian12
 
What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?
What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?
What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?Smarten Augmented Analytics
 
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
 
Big Data Analytics.pptx
Big Data Analytics.pptxBig Data Analytics.pptx
Big Data Analytics.pptxKaviya452563
 
Linear logisticregression
Linear logisticregressionLinear logisticregression
Linear logisticregressionkongara
 
Machine Learning Unit 3 Semester 3 MSc IT Part 2 Mumbai University
Machine Learning Unit 3 Semester 3  MSc IT Part 2 Mumbai UniversityMachine Learning Unit 3 Semester 3  MSc IT Part 2 Mumbai University
Machine Learning Unit 3 Semester 3 MSc IT Part 2 Mumbai UniversityMadhav Mishra
 

Similar to Logistic Regression power point presentation.pptx (20)

Logistic Regression in machine learning.docx
Logistic Regression in machine learning.docxLogistic Regression in machine learning.docx
Logistic Regression in machine learning.docx
 
NPTL Machine Learning Week 2.docx
NPTL Machine Learning Week 2.docxNPTL Machine Learning Week 2.docx
NPTL Machine Learning Week 2.docx
 
Logistic Regression.pptx
Logistic Regression.pptxLogistic Regression.pptx
Logistic Regression.pptx
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
 
Predicting Employee Attrition
Predicting Employee AttritionPredicting Employee Attrition
Predicting Employee Attrition
 
Logistic regression - one of the key regression tools in experimental research
Logistic regression - one of the key regression tools in experimental researchLogistic regression - one of the key regression tools in experimental research
Logistic regression - one of the key regression tools in experimental research
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)
 
Data Science - Part IV - Regression Analysis & ANOVA
Data Science - Part IV - Regression Analysis & ANOVAData Science - Part IV - Regression Analysis & ANOVA
Data Science - Part IV - Regression Analysis & ANOVA
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
 
GLMs.pptx
GLMs.pptxGLMs.pptx
GLMs.pptx
 
2018 p 2019-ee-a2
2018 p 2019-ee-a22018 p 2019-ee-a2
2018 p 2019-ee-a2
 
working with python
working with pythonworking with python
working with python
 
What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?
What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?
What is Isotonic Regression and How Can a Business Utilize it to Analyze Data?
 
Machine Learning.pdf
Machine Learning.pdfMachine Learning.pdf
Machine Learning.pdf
 
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)
 
Regression ppt.pptx
Regression ppt.pptxRegression ppt.pptx
Regression ppt.pptx
 
Big Data Analytics.pptx
Big Data Analytics.pptxBig Data Analytics.pptx
Big Data Analytics.pptx
 
Linear logisticregression
Linear logisticregressionLinear logisticregression
Linear logisticregression
 
Machine Learning Unit 3 Semester 3 MSc IT Part 2 Mumbai University
Machine Learning Unit 3 Semester 3  MSc IT Part 2 Mumbai UniversityMachine Learning Unit 3 Semester 3  MSc IT Part 2 Mumbai University
Machine Learning Unit 3 Semester 3 MSc IT Part 2 Mumbai University
 
Ai saturdays presentation
Ai saturdays presentationAi saturdays presentation
Ai saturdays presentation
 

Recently uploaded

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Logistic Regression power point presentation.pptx

  • 2. What is Logistic Regression?  Logistic Regression is a supervised algorithm for binary and multi-class classification tasks.  It is a widely used method for predicting the probability of an instance belonging to a specific class instead of simple binary prediction.  Logistic Regression accepts independent variables as input and predicts the categorical outcome of the dependent variable.
  • 3. Independent Variables  These are the input variables and are also known as features or predictors.  The model takes these as input and makes predictions about the probability of an instance belonging to a category.  E.g.- For predicting heart disease, independent variables will be Age, Cholesterol Level, Blood Pressure etc.
  • 4. Dependent Variables  These are outcome or target variables that are predicted based on features(independent variables).  These are categorical variables for which we estimate the probability of certain categories.  E.g.- For heart disease prediction, the dependent variable will be 1 (have heart disease) or 0 (does not have).
  • 5. How it is different from Linear Regression? Linear Regression  Linear Regression is used for predicting continuous numeric values.  It models the relationship between independent variables and a dependent variable by fitting a linear equation. Logistic Regression  Logistic Regression is used for binary classification tasks.  It predicts the probability of an instance belonging to a specific class.
  • 6. Linear Regression  The output of Linear Regression is a continuous numerical value.  It is suitable for problems where the dependent variable is numeric. E.g.- For predicting Stock prices, Housing prices, Air Quality prediction etc. Logistic Regression  The output of Logistic Regression is a probability value between 0 and 1 that represents the probability of belonging to a particular class.  It is suitable for binary classification. E.g.- Predicting medical conditions, Churn Prediction, Spam detection etc.
  • 7. Model Components  Input Features(X) These are the independent variables or features that describe the data instances we work with.  Weights(θ) Weights refer to the coefficients assigned to each independent variable (feature) in the linear combination that is used to make predictions. These weights determine the influence of each feature on the final prediction.
  • 8.  Bias(θ₀) In Logistic Regression “Bias” refers to the intercept term in the linear equation. It allows the linear model to make predictions even when all input features are zero. Here, z is the linear combination θ₀(represented as b) is bias w is the weight associated with each feature
  • 9.  Sigmoid Function (Logistic function) The sigmoid function is a crucial component that transforms the linear combination of input features and their associated weights into a probability value. If the output of the sigmoid function is greater than or equal to Decision Boundary (generally 0.5), the instance is predicted to belong to the positive class otherwise to the negative class. P(y = 1|X) =
  • 11. Cost Function  A cost function (also known as a loss function) is a measure that quantifies the discrepancy between the predicted values of a model and the actual values.  The goal is to minimize this loss function during model training to achieve accurate predictions.  In the case of Logistic Regression, the cost function is often the log loss or cross-entropy loss.  During model training, optimization algorithms like gradient descent are used to iteratively update the model parameters(θ) to minimize the log loss function.
  • 13. Optimization Techniques Regularization  Regularization is a technique used in machine learning to prevent overfitting and improve the generalization ability of a model.  Regularization is particularly useful when dealing with complex models that have a high number of features or parameters.  L1-Regularization(Lasso)
  • 15. Gradient Descent  Gradient descent is an iterative optimization algorithm that updates the model's parameters in the opposite direction of the gradient of the cost function.  Gradient descent takes steps in the parameter space that lead to lower values of the cost function.
  • 16. Model Evaluation  Accuracy Accuracy is the ratio of correctly predicted instances to the total number of instances in the testing set.  Precision Precision measures the proportion of correctly predicted positive instances out of all instances predicted as positive.
  • 17.  Recall(Sensitivity) Recall measures the proportion of correctly predicted positive instances out of all actual positive instances.  F1-Score The F1-score is the harmonic mean of precision and recall, providing a balanced measure of the model's accuracy.
  • 18.  Receiver Operating Characteristic (ROC) Curve  It is a graphical representation that shows the performance of a classification model across different levels of decision thresholds.  It plots the true positive rate (recall) against the false positive rate at various threshold settings, providing valuable insights into the model's ability to distinguish between positive and negative classes.
  • 19.
  • 20. Applications  Medical Diagnosis and Healthcare  Market and Consumer Analysis  Image and Object Recognition  Fraud Detection  Social Sciences and Political Analysis  Natural Language Processing (NLP)
  • 21. Advantages and Limitations  Advantages  Logistic regression is computationally efficient and can handle relatively large datasets with ease.  Compared to more complex models, logistic regression has a lower risk of overfitting.  Logistic regression is specifically designed for binary classification problems.  Logistic regression can help identify important features that have a significant impact on the outcome.
  • 22.  Limitations  When dealing with high-dimensional data, logistic regression can become prone to overfitting.  Logistic regression is inherently designed for binary classification problems. So multi-class problems might not be as straightforward to interpret.  Logistic regression is sensitive to outliers, especially if the dataset is small.  Logistic regression requires complete data for all variables. Dealing with missing data can be challenging.  When dealing with imbalanced datasets (where one class is much more frequent than the other), logistic regression might struggle to predict the minority class effectively.