SlideShare a Scribd company logo
Difference Between Logistic
Regression-Shallow Neural
Network and Deep Neural
Network
BY Chode Amarnath
Learning Objective :
→ Why we use supervised learning instead of unsupervised for Neural networks?
→ Why we use Logistic regression for Neural network?
Difference between logistic regression  shallow neural network and deep neural network
Supervised learning
→ In supervised learning, we are given a data set and already know what our
correct output should look like, having the idea that there is a relationship between the
input and the output.
→ Supervised learning problems are categorized into
1) Regression.
2) Classification problems.
Classification
→ In a classification problem, we are instead trying to predict results in a
discrete output. In other words, we are trying to map input variables into discrete
categories.
→ The main goal of classification is to predict the target class (Yes/
No).
→ The classification problem is just like the regression problem, except that
the values we now want to predict take on only a small number of discrete values.
For now, we will focus on the binary classification problem in which y can take on
only two values, 0 and 1.
Types of classification:
Binary classification.
When there are only two classes to predict, usually 1 or 0 values.
Multi-Class Classification
When there are more than two class labels to predict we call multi-classification
task.
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Regression
→ In a regression problem, we are trying to predict results within a continuous
output, meaning that we are trying to map input variables to some continuous function.
→ In regression task , the target value is a continuously varying variable. Such
as country’s GDP (or) the price of a house.
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Cost Function
→ We can measure the accuracy of our hypothesis function by using a cost
function.
→ It also called as Square Error Function.
→ Our objective is to get the best possible line. The best possible line will be
such so that the average squared vertical distances of the scattered points from the line
will be the least.
→ Ideally, the line should pass through all the points of our training data set. In
such a case, the value of J(theta_0, theta_1)will be 0.
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
We want an efficient algorithm or a piece of software for automatically finding theta 0
and theta1.
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Logistic regression model
→ we would like our classifier to output values between 0 and 1, so we would
come up with hypothesis that satisfies this property, that is predictions are between 0
and 1.
→ As Z goes minus infinity g(z) approaches Zero.
→ As g(z) approaches infinity, g(z) approaches one.
→ hθ​(x) will give us the probability that our output is 1.
For example, hθ(x)=0.7 gives us a probability of 70% that our output is 1. Our
probability that our prediction is 0 is just the complement of our probability that it is 1
(e.g. if probability that it is 1 is 70%, then the probability that it is 0 is 30%).
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Decision Boundary
→
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Logistic Regression
→ Given an input feature vector X maybe corresponding to an image that we
want to recognize as either a cat picture or not a cat picture.
→ we want an algorithm that can output a prediction, which is your
estimate(probability of chance) of y.
→ X is a n dimensional vector and given that the parameter of logistic
regression.
→ So, given an input X and the parameters W and b, how do we generate the
output y(hat).
→ We’ll usually keep the parameter W and B separate,
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Logistic Regression Cost Function
→ What loss function or error function we can use to measure how well your
algorithm is doing.
→ The cost function measures, how well your parameters W and b are doing on
the training set.
→ To train the parameters W and B of the logistic regression, we need to define a
cost function.
→ The Loss function was defined with respect to a single training example
→ Cost function measures, how we’ll you’re doing an entire training set.
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Gradient Descent
→ How can we use the gradient descent algorithm to train or learn, the
parameters W and B on your training set.
→ Find W and B that makes the cost function as small as possible.
→ Height of the surface represent the Value J(w,b) at a certain point.
→ we to find the value of w and b that correspond to the minimum of the cost
function J.
→ Initialize W and B to some values, denoted by this little red dot, Initialize to zero
or random initialization also works.
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Shallow Neural Network
→ In Logistic regression, we had Z followed by a calculation.
→ In Neural network, we just do it multiple times Z followed by a calculation.
→ finally compute the loss at end.
→ in logistic regression, we have backward calculation in order to compute
devitives.
→ in Neural network end up doing a backward calculation
Difference between logistic regression  shallow neural network and deep neural network
→ The Circle logistic regression really represents two steps of computation
→ First we compute Z,
→ Second we compute the activation as a sigmoid function of Z.
→ A neural network does this a lot of times
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Activation Function
- When you build your neural network, one of the choice you get to make is what
activation function to use in the hidden layers and as well as what is the output
units of your neural network.
- If you let the function g(z) = tanh(z) this almost work better than the sigmoid
function, Because the values between +1 and -1, the mean of the activations that come
out of the hidden layer are close to having 0 mean
- the mean of the data is close to 1 rather than 0.5
- This actually makes learning for next layer a little bit easier
One of the down side of both sides of both the sigmoid and tanh function is
- If Z is very large are small then the gradient or the derivative or the slope of the
function is very small
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network
Difference between logistic regression  shallow neural network and deep neural network

More Related Content

What's hot (20)

PPTX
Candidate elimination example
Menoufiya University
 
PPTX
Coding and testing in Software Engineering
Abhay Vijay
 
PPT
Linear Algebra
melvincabatuan
 
PPT
UML Architecture and Views
Kumar
 
PPT
Unit 5 testing -software quality assurance
gopal10scs185
 
DOCX
Uml diagrams
Yaswanth Babu Gummadivelli
 
PPT
Artificial Neural Networks - ANN
Mohamed Talaat
 
PPTX
Project scheduling and tracking
Computer_ at_home
 
PPTX
Ch 1 the software quality assurance challange
Kittitouch Suteeca
 
PPT
hidden surface removal in computer graphics
srinivasan779644
 
PPTX
software product and its characteristics
Priyanka Pradhan
 
PDF
Object Oriented Analysis Design using UML
Ajit Nayak
 
ODP
Introduction to Machine Learning with Find-S
Knoldus Inc.
 
PDF
Chapter 2 part3-Least-Squares Regression
nszakir
 
PDF
Review of linear algebra
Hiroki Sayama
 
PPT
fuzzy_measures.ppt
JanosBotzheim
 
PDF
1. Regression_V1.pdf
ssuser4c50a9
 
PPT
complex variable PPT ( SEM 2 / CH -2 / GTU)
tejaspatel1997
 
PPT
Normal distribution
manzara arshad
 
PDF
Graph Based Pattern Recognition
Nicola Strisciuglio
 
Candidate elimination example
Menoufiya University
 
Coding and testing in Software Engineering
Abhay Vijay
 
Linear Algebra
melvincabatuan
 
UML Architecture and Views
Kumar
 
Unit 5 testing -software quality assurance
gopal10scs185
 
Artificial Neural Networks - ANN
Mohamed Talaat
 
Project scheduling and tracking
Computer_ at_home
 
Ch 1 the software quality assurance challange
Kittitouch Suteeca
 
hidden surface removal in computer graphics
srinivasan779644
 
software product and its characteristics
Priyanka Pradhan
 
Object Oriented Analysis Design using UML
Ajit Nayak
 
Introduction to Machine Learning with Find-S
Knoldus Inc.
 
Chapter 2 part3-Least-Squares Regression
nszakir
 
Review of linear algebra
Hiroki Sayama
 
fuzzy_measures.ppt
JanosBotzheim
 
1. Regression_V1.pdf
ssuser4c50a9
 
complex variable PPT ( SEM 2 / CH -2 / GTU)
tejaspatel1997
 
Normal distribution
manzara arshad
 
Graph Based Pattern Recognition
Nicola Strisciuglio
 

Similar to Difference between logistic regression shallow neural network and deep neural network (20)

PPTX
Lecture02_Updated_Shallow Neural Networks.pptx
UzairAli65885
 
PPTX
PRML Chapter 4
Sunwoo Kim
 
PDF
Machine Learning with Python- Machine Learning Algorithms- Logistic Regressio...
KalighatOkira
 
PPTX
5_LR_Apr_7_2021.pptx in nature language processing
attaurahman
 
PPTX
Deep learning: Mathematical Perspective
YounusS2
 
PPTX
Illustrative Introductory Neural Networks
YasutoTamura1
 
PDF
Explore ml day 2
preetikumara
 
PPTX
Machine Learning using Support Vector Machine
Mohsin Ul Haq
 
PPTX
07 logistic regression and stochastic gradient descent
Subhas Kumar Ghosh
 
PDF
Linear logisticregression
kongara
 
PDF
6 logistic regression classification algo
TanmayVijay1
 
PDF
Machine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Jonathan Mitchell
 
PDF
Analysis and Design of Algorithms notes
Prof. Dr. K. Adisesha
 
PPTX
ML Workshop at SACON 2018
Subrat Panda, PhD
 
PDF
working with python
bhavesh lande
 
PPTX
Introduction to Neural Netwoks
Abdallah Bashir
 
PPTX
Lecture 3.1_ Logistic Regression powerpoint
zahidwadiwale
 
PDF
Machine learning
Shreyas G S
 
PDF
Sienna 13 limitations
chidabdu
 
PDF
Introduction to Variational Auto Encoder
vaidehimadaan041
 
Lecture02_Updated_Shallow Neural Networks.pptx
UzairAli65885
 
PRML Chapter 4
Sunwoo Kim
 
Machine Learning with Python- Machine Learning Algorithms- Logistic Regressio...
KalighatOkira
 
5_LR_Apr_7_2021.pptx in nature language processing
attaurahman
 
Deep learning: Mathematical Perspective
YounusS2
 
Illustrative Introductory Neural Networks
YasutoTamura1
 
Explore ml day 2
preetikumara
 
Machine Learning using Support Vector Machine
Mohsin Ul Haq
 
07 logistic regression and stochastic gradient descent
Subhas Kumar Ghosh
 
Linear logisticregression
kongara
 
6 logistic regression classification algo
TanmayVijay1
 
Machine learning pt.1: Artificial Neural Networks ® All Rights Reserved
Jonathan Mitchell
 
Analysis and Design of Algorithms notes
Prof. Dr. K. Adisesha
 
ML Workshop at SACON 2018
Subrat Panda, PhD
 
working with python
bhavesh lande
 
Introduction to Neural Netwoks
Abdallah Bashir
 
Lecture 3.1_ Logistic Regression powerpoint
zahidwadiwale
 
Machine learning
Shreyas G S
 
Sienna 13 limitations
chidabdu
 
Introduction to Variational Auto Encoder
vaidehimadaan041
 
Ad

More from Chode Amarnath (6)

PPTX
Important Classification and Regression Metrics.pptx
Chode Amarnath
 
PPTX
Vectorization In NLP.pptx
Chode Amarnath
 
PPTX
The 10 Algorithms Machine Learning Engineers Need to Know.pptx
Chode Amarnath
 
PPTX
Bag the model with bagging
Chode Amarnath
 
PPTX
Feature engineering mean encodings
Chode Amarnath
 
PPTX
Validation and Over fitting , Validation strategies
Chode Amarnath
 
Important Classification and Regression Metrics.pptx
Chode Amarnath
 
Vectorization In NLP.pptx
Chode Amarnath
 
The 10 Algorithms Machine Learning Engineers Need to Know.pptx
Chode Amarnath
 
Bag the model with bagging
Chode Amarnath
 
Feature engineering mean encodings
Chode Amarnath
 
Validation and Over fitting , Validation strategies
Chode Amarnath
 
Ad

Recently uploaded (20)

PPTX
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
PPTX
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
PDF
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
PPTX
apidays Singapore 2025 - From Data to Insights: Building AI-Powered Data APIs...
apidays
 
PPTX
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
PDF
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
PPTX
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
PPTX
apidays Helsinki & North 2025 - APIs at Scale: Designing for Alignment, Trust...
apidays
 
PDF
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
PPTX
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PDF
Research Methodology Overview Introduction
ayeshagul29594
 
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
PPTX
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
PPTX
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
PDF
Data Retrieval and Preparation Business Analytics.pdf
kayserrakib80
 
PPTX
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PDF
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
PDF
apidays Singapore 2025 - Trustworthy Generative AI: The Role of Observability...
apidays
 
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
apidays Singapore 2025 - From Data to Insights: Building AI-Powered Data APIs...
apidays
 
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
apidays Helsinki & North 2025 - APIs at Scale: Designing for Alignment, Trust...
apidays
 
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
Research Methodology Overview Introduction
ayeshagul29594
 
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
Data Retrieval and Preparation Business Analytics.pdf
kayserrakib80
 
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
apidays Singapore 2025 - Trustworthy Generative AI: The Role of Observability...
apidays
 

Difference between logistic regression shallow neural network and deep neural network

  • 1. Difference Between Logistic Regression-Shallow Neural Network and Deep Neural Network BY Chode Amarnath
  • 2. Learning Objective : → Why we use supervised learning instead of unsupervised for Neural networks? → Why we use Logistic regression for Neural network?
  • 4. Supervised learning → In supervised learning, we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output. → Supervised learning problems are categorized into 1) Regression. 2) Classification problems.
  • 5. Classification → In a classification problem, we are instead trying to predict results in a discrete output. In other words, we are trying to map input variables into discrete categories. → The main goal of classification is to predict the target class (Yes/ No). → The classification problem is just like the regression problem, except that the values we now want to predict take on only a small number of discrete values. For now, we will focus on the binary classification problem in which y can take on only two values, 0 and 1.
  • 6. Types of classification: Binary classification. When there are only two classes to predict, usually 1 or 0 values. Multi-Class Classification When there are more than two class labels to predict we call multi-classification task.
  • 10. Regression → In a regression problem, we are trying to predict results within a continuous output, meaning that we are trying to map input variables to some continuous function. → In regression task , the target value is a continuously varying variable. Such as country’s GDP (or) the price of a house.
  • 15. Cost Function → We can measure the accuracy of our hypothesis function by using a cost function. → It also called as Square Error Function. → Our objective is to get the best possible line. The best possible line will be such so that the average squared vertical distances of the scattered points from the line will be the least. → Ideally, the line should pass through all the points of our training data set. In such a case, the value of J(theta_0, theta_1)will be 0.
  • 19. We want an efficient algorithm or a piece of software for automatically finding theta 0 and theta1.
  • 33. Logistic regression model → we would like our classifier to output values between 0 and 1, so we would come up with hypothesis that satisfies this property, that is predictions are between 0 and 1. → As Z goes minus infinity g(z) approaches Zero. → As g(z) approaches infinity, g(z) approaches one. → hθ​(x) will give us the probability that our output is 1. For example, hθ(x)=0.7 gives us a probability of 70% that our output is 1. Our probability that our prediction is 0 is just the complement of our probability that it is 1 (e.g. if probability that it is 1 is 70%, then the probability that it is 0 is 30%).
  • 47. Logistic Regression → Given an input feature vector X maybe corresponding to an image that we want to recognize as either a cat picture or not a cat picture. → we want an algorithm that can output a prediction, which is your estimate(probability of chance) of y. → X is a n dimensional vector and given that the parameter of logistic regression. → So, given an input X and the parameters W and b, how do we generate the output y(hat). → We’ll usually keep the parameter W and B separate,
  • 50. Logistic Regression Cost Function → What loss function or error function we can use to measure how well your algorithm is doing. → The cost function measures, how well your parameters W and b are doing on the training set. → To train the parameters W and B of the logistic regression, we need to define a cost function. → The Loss function was defined with respect to a single training example → Cost function measures, how we’ll you’re doing an entire training set.
  • 53. Gradient Descent → How can we use the gradient descent algorithm to train or learn, the parameters W and B on your training set. → Find W and B that makes the cost function as small as possible. → Height of the surface represent the Value J(w,b) at a certain point. → we to find the value of w and b that correspond to the minimum of the cost function J. → Initialize W and B to some values, denoted by this little red dot, Initialize to zero or random initialization also works.
  • 57. Shallow Neural Network → In Logistic regression, we had Z followed by a calculation. → In Neural network, we just do it multiple times Z followed by a calculation. → finally compute the loss at end. → in logistic regression, we have backward calculation in order to compute devitives. → in Neural network end up doing a backward calculation
  • 59. → The Circle logistic regression really represents two steps of computation → First we compute Z, → Second we compute the activation as a sigmoid function of Z. → A neural network does this a lot of times
  • 65. Activation Function - When you build your neural network, one of the choice you get to make is what activation function to use in the hidden layers and as well as what is the output units of your neural network. - If you let the function g(z) = tanh(z) this almost work better than the sigmoid function, Because the values between +1 and -1, the mean of the activations that come out of the hidden layer are close to having 0 mean - the mean of the data is close to 1 rather than 0.5 - This actually makes learning for next layer a little bit easier
  • 66. One of the down side of both sides of both the sigmoid and tanh function is - If Z is very large are small then the gradient or the derivative or the slope of the function is very small