SlideShare a Scribd company logo
1 of 27
Machine Learning using
Classification
Feed Forward Neural Network
1
Agenda
1. Machine Learning Definition.
2. Types of machine learning.
3. Classification Definition.
4. Classification Algorithms.
5. Components of learning.
6. Neural Network.
7. Single layer perceptron.
Feed Forward Neural Network
2
What is machine learning?
Definition of Machine Learning from WhatIS.com
β€œis a type of artificial intelligence (AI) that allows software
applications to become more accurate in predicting outcomes
without being explicitly programmed”.
Definition of Machine Learning from dictionary.com
β€œThe ability of a machine to improve its performance based on previous
results.”
Feed Forward Neural Network
3
Types of machine Learning
Machine
learning
categorization
Supervised
Learning
UnSupervised
Learning
Enforcement
Learning
Regression /
classification
clustering
Feed Forward Neural Network
4
Supervised Learning β€œClassification”
οƒ˜In machine learning and statistics, classification is a supervised
learning approach in which the computer program learns from the
data input given to it and then uses this learning to classify new
observation.
?
Feed Forward Neural Network
5
Classification algorithms:
1. Logistic Regression.
2. NaΓ―ve Bayes.
3. K-Nearest Neighbors.
4. Decision Tree.
5. Support Vector Machine.
6. Neural Network.
Feed Forward Neural Network
6
Components of learning
β€’ Example:-Suppose that you are a bank manger and you want to
predict your customers behavior in the future according to their
historical data in order to make a credit card for money withdrawing
or not (approve it or deny).
23 years
Age
Male
Gender
$30,000
Annual Salary
1 Year
Years in residence
1 Year
Years in job
$ 15,000
Current debt
Sample of data vector
Feed Forward Neural Network
7
Components of learning cont.
β€’ Formalization:-
β€’ Input : x (vector of data β€˜Customer Application’).
β€’ Output : y (good/bad customer).
β€’ Target Function : 𝒇: 𝒙 β†’ π’š (ideal credit approval formula).
β€œit is unknown function as if it known we don’t need to learn the machine and just go
ahead and implement our algorithm”.
β€’ Data : π’™πŸ, π’šπŸ , π’™πŸ, π’šπŸ , … 𝒙𝒏, π’šπ’ (Historical data)
β€’ Hypothesis: g: 𝒙 β†’ π’š
β€’ we will use the historical data above in order to get the hypothesis which is the formal
name we are going to call the formula we get.
Feed Forward Neural Network
8
Components of learning cont.
ideal credit approval formula
Historical records of credit customers
Learning
Algorithm
Unknown target function
𝒇: 𝒙 β†’ π’š
Training Example
π’™πŸ, π’šπŸ , π’™πŸ, π’šπŸ , … 𝒙𝒏, π’šπ’
Final Hypothesis
π’ˆ β‰ˆ 𝒇
Hypothesis Set
𝑯
Set of candidate formula
Final credit Approval formula
Both of them are
called β€œLearning
Model”
Feed Forward Neural Network
9
β€’ For input 𝑿 = (π’™πŸ, π’™πŸ, π’™πŸ‘ , … , 𝒙𝒏) β€˜Attributes of the customer’
Approve credit if π’Š=𝟏
𝒏
wixi > 𝒕𝒉𝒓𝒆𝒔𝒐𝒍𝒅
Deny credit if π’Š=𝟏
𝒏
wixi < 𝒕𝒉𝒓𝒆𝒔𝒐𝒍𝒅
So β„Ž π‘₯ = 𝑠𝑖𝑔𝑛(( π’Š=𝟏
𝒏
wixi )- threshold))
A simple hypothesis β€œThe perceptron”
Feed Forward Neural Network
10
A simple hypothesis β€œThe perceptron”
cont.
β€’ β„Ž π‘₯ = 𝑠𝑖𝑔𝑛(( π’Š=𝟏
𝒏
wixi )- threshold))
β€’ β„Ž π‘₯ = 𝑠𝑖𝑔𝑛(( π’Š=𝟏
𝒏
wixi ) + w0 ))
β€’ β„Ž π‘₯ = 𝑠𝑖𝑔𝑛( π’Š=𝟎
𝒏
wixi )
Why W0 in order to get the following formula
by introducing an artificial coordinate
or vector called the bias x0=1
Feed Forward Neural Network
11
Neural Network β€œsingle layer perceptron”
β€’ is a system that is based on the biological neural
network, such as the brain. The brain has
approximately 100 billion neurons, which
communicate through electro-chemical signals.
β€’ Each neuron receives thousands of connections
with other neurons, constantly receiving
incoming signals to reach the cell body.
β€’ If the resulting sum of the signals surpasses a
certain threshold, a response is sent through the
axon.
Feed Forward Neural Network
12
Neural Network β€œsingle layer
perceptron”cont.
β€’ is comprised of a network of artificial neurons (also known as
"nodes").
β€’ These nodes are connected to each other, and the strength of their
connections to one another is assigned a value based on their
strength: inhibition (maximum being -1.0 week connection) or
excitation (maximum being +1.0 strong connection) we call them
weights.
β€’ Three types of nodes:
β€’ Input nodes.
β€’ Hidden nodes.
β€’ Output nodes.
Feed Forward Neural Network
13
Neural Network β€œsingle layer
perceptron”cont.
β€’ There are two types of neural network:
1. Single layer neural network β€œPerceptron”.
2. Multilayer neural network.
Feed Forward Neural Network
14
Neural Network β€œsingle layer
perceptron”cont.
Algorithm steps:
1. Start with the first sample.(Note: initial weights = 0)
2. Calculate Net = π’Š=𝟎
𝒏
wixi .
EX:- Net = w1x1 + w2x2 + w0x0
Where x0 is a feature vector used to reduce number of iterations to get the optimal
line that used to separate the data it is called β€œBias” its initial value =1.
3. Calculate f(Net) : which is called :
1. Transfer function. 2. Activation function.
Ex :- F(Net) =
1 𝑁𝑒𝑑 β‰₯ 0
0 𝑁𝑒𝑑 < 0
4. If Output = Desired then go to next sample.
else Output β‰  Desired Update weights then go to next sample.
5. Terminate step: find weights correct to all samples:
βˆ†wi= Ξ· * ( Desired – Output) * xi
βˆ†w = New weight - Old weight
New Weight = βˆ†w + Old Weight
Ξ· is called learning rate
β€œEta” used also to reduce
number of iterations
especially during weights
updating initially = 1
Feed Forward Neural Network
15
Example :Single Layer Perceptron
β€’ Consider the following training data set:
1. Is the problem solvably ?Why?!
2. If it is solvable find weights using
perceptron single layer? Given :
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
1. Classify the following samples:
1. (-2.0) .
2. (1,1).
3. (0,1).
4. (-1,-2).
Desired
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
Ξ·=1
Feed Forward Neural Network
16
Example :Single Layer Perceptron cont.
Solution
1. The problem can be solved because it has only two classes (1, -1) ,so it can be solved
using single layer perceptron.
2. The problem can be solved using tow ways:
1. Using Graph :
Represent the data set points on x and y
and find separable line between those two classes.
π‘¦βˆ’y1
π‘₯βˆ’x1
=
y2βˆ’y1
x2βˆ’x1

π‘¦βˆ’ 1
π‘₯+0.5
=
βˆ’1βˆ’1
βˆ’0.5+0.5
π‘¦βˆ’ 1
π‘₯+0.5
=
βˆ’2
0
 -2x-1 = 0y  -2 x - 0y - 1 =0
w1x1 + w2x2 + w0x0
so w1 =-2 , w2 =0 , w0 =-1
-1
-2
1
2
-1
-2
1 2
(-0.5,1)
(-0.5,-1)
(-0.5,1) (-0.5,-1)
(x2, y2)
(x1, y1)
Feed Forward Neural Network
17
Example :Single Layer Perceptron cont.
2. Using perceptron :
1. Take the first sample, and initialize all weights to zero:
2. Calculate Net = π’Š=𝟎
𝒏
wixi = 0*1 + 0*-1 + 0*1 = 0
f(Net) = -1
3. while f(net) β‰  desired so update weights and go to next sample
4. βˆ†w0= Ξ· * ( Desired – Output) * xi = 1*(1+1)*1 =2
w0new = βˆ†w0+ wold = 2 + 0 = 2
βˆ†w1= Ξ· * ( Desired – Output) * xi = 1*(1+1)*-1 =-2
w1new = βˆ†w1+ wold = -2 + 0 = -2
βˆ†w2= Ξ· * ( Desired – Output) * xi = 1*(1+1)*1 =2
w2new = βˆ†w2+ wold = 2 + 0 = 2  go to next sample
W2 = 0
W1 = 0
W0 = 0
x2 = 1
x1 = -1
x0 = 1
y
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
Feed Forward Neural Network
18
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Example :Single Layer Perceptron cont.
1. Take the Second sample, and initialize all weights to zero:
2. Calculate Net = π’Š=𝟎
𝒏
wixi = 2*1 + -2*0 + 2*1 = 4
f(Net) = 1
3. while f(net) β‰  desired so update weights and go to next sample
4. βˆ†w0= Ξ· * ( Desired – Output) * xi = 1*(-1-1)*1 =-2
w0new = βˆ†w0+ wold = -2 + 2 = 0
βˆ†w1= Ξ· * ( Desired – Output) * xi = 1*(-1-1)*0 =0
w1new = βˆ†w1+ wold = 0 -2 = -2
βˆ†w2= Ξ· * ( Desired – Output) * xi = 1*(-1-1)*1 =-2
w2new = βˆ†w2+ wold = -2 +2 = 0  go to next sample
W2 = 2
W1 = -2
W0 = 2
x2 = 1
x1 = 0
x0 = 1
y
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
Feed Forward Neural Network
19
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Example :Single Layer Perceptron cont.
1. Take the third sample, and initialize all weights to zero:
2. Calculate Net = π’Š=𝟎
𝒏
wixi = 0*1 + -2*-1 + 0*-1 = 2
f(Net) = 1
3. while f(net) = desired so keep weights as they are and go to next sample
W2 = 0
W1 = -2
W0 = 0
x2 = -1
x1 = -1
x0 = 1
y
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
Feed Forward Neural Network
20
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Example :Single Layer Perceptron cont.
1. Take the fourth sample, and initialize all weights to zero:
2. Calculate Net = π’Š=𝟎
𝒏
wixi = 0*1 + -2*0 + 0*-1 = 0
f(Net) = -1
3. while f(net) = desired so keep weights as they are and go to next sample
W2 = 0
W1 = -2
W0 = 0
x2 = -1
x1 = 0
x0 = 1
y
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
Feed Forward Neural Network
21
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Example :Single Layer Perceptron cont.
1. Back again to the first sample, and initialize all weights to zero:
2. Calculate Net = π’Š=𝟎
𝒏
wixi = 0*1 + -2*-1 + 0*1 = 2
f(Net) = 1
3. while f(net) = desired so keep weights as they are and go to next sample
W2 = 0
W1 = -2
W0 = 0
x2 = 1
x1 = -1
x0 = 1
y
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
Feed Forward Neural Network
22
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Example :Single Layer Perceptron cont.
1. Back again to the first sample, and initialize all weights to zero:
2. Calculate Net = π’Š=𝟎
𝒏
wixi = 0*1 + -2*0 + 0*1 = 0
f(Net) = -1
3. while f(net) = desired so keep weights as they are and go to next sample
so the weighs used for this set is
W2 = 0
W1 = -2
W0 = 0
x2 = 1
x1 = 0
x0 = 1
y
x2
X1
x0
1
1
-1
1
-1
1
0
1
1
-1
-1
1
-1
-1
0
1
W2 = 0
W1 = -2
W0 = 0
Feed Forward Neural Network
23
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Example :Single Layer Perceptron cont.
3. (-2, 0) = 𝐒=𝟎
𝐧
wixi = 0*1 + -2*-2 + 0*0 = 4
f(Net) = 1 so it is classified as class 1
(1, 1) = 𝐒=𝟎
𝐧
wixi = 0*1 + 1*-2 + 1*0 = -2
f(Net) = 1 so it is classified as class -1
(0, 1) = 𝐒=𝟎
𝐧
wixi = 0*1 + 0*-2 + 0*1 = 0
f(Net) = 1 so it is classified as class -1
(-1, -2) = 𝐒=𝟎
𝐧
wixi = 0*1 + -2*-1 + 0*-2 = 2
f(Net) = 1 so it is classified as class 1
Feed Forward Neural Network
24
F(Net) =
1 𝑁𝑒𝑑 > 0
βˆ’1 𝑁𝑒𝑑 ≀ 0
Perceprton implementation using
matlab
Feed Forward Neural Network
25
Simple Run using previous code
Step 1 : initialize input
Step 2 : initialize output
Step 3 : Call the function
Step 4 : testing sample
Feed Forward Neural Network
26
The End
Feed Forward Neural Network
27

More Related Content

Similar to Classification using perceptron.pptx

Artificial Neural Networks Lect7: Neural networks based on competition
Artificial Neural Networks Lect7: Neural networks based on competitionArtificial Neural Networks Lect7: Neural networks based on competition
Artificial Neural Networks Lect7: Neural networks based on competitionMohammed Bennamoun
Β 
neural.ppt
neural.pptneural.ppt
neural.pptKabileshCm
Β 
neural (1).ppt
neural (1).pptneural (1).ppt
neural (1).pptAlmamoon
Β 
neural.ppt
neural.pptneural.ppt
neural.pptOhadEfrati1
Β 
2.5 backpropagation
2.5 backpropagation2.5 backpropagation
2.5 backpropagationKrish_ver2
Β 
Artificial Neural Networks
Artificial Neural NetworksArtificial Neural Networks
Artificial Neural NetworksArslan Zulfiqar
Β 
Soft Computering Technics - Unit2
Soft Computering Technics - Unit2Soft Computering Technics - Unit2
Soft Computering Technics - Unit2sravanthi computers
Β 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Networkssuserab4f3e
Β 
SOFT COMPUTERING TECHNICS -Unit 1
SOFT COMPUTERING TECHNICS -Unit 1SOFT COMPUTERING TECHNICS -Unit 1
SOFT COMPUTERING TECHNICS -Unit 1sravanthi computers
Β 
Multilayer Backpropagation Neural Networks for Implementation of Logic Gates
Multilayer Backpropagation Neural Networks for Implementation of Logic GatesMultilayer Backpropagation Neural Networks for Implementation of Logic Gates
Multilayer Backpropagation Neural Networks for Implementation of Logic GatesIJCSES Journal
Β 
Neural_N_Problems - SLP.pdf
Neural_N_Problems - SLP.pdfNeural_N_Problems - SLP.pdf
Neural_N_Problems - SLP.pdf8dunderground
Β 
Neurvvvvvvvvvvvvvvvvvvvval Networks.pptx
Neurvvvvvvvvvvvvvvvvvvvval Networks.pptxNeurvvvvvvvvvvvvvvvvvvvval Networks.pptx
Neurvvvvvvvvvvvvvvvvvvvval Networks.pptxeman458700
Β 
Unsupervised-learning.ppt
Unsupervised-learning.pptUnsupervised-learning.ppt
Unsupervised-learning.pptGrishma Sharma
Β 

Similar to Classification using perceptron.pptx (20)

Artificial Neural Networks Lect7: Neural networks based on competition
Artificial Neural Networks Lect7: Neural networks based on competitionArtificial Neural Networks Lect7: Neural networks based on competition
Artificial Neural Networks Lect7: Neural networks based on competition
Β 
neural.ppt
neural.pptneural.ppt
neural.ppt
Β 
neural.ppt
neural.pptneural.ppt
neural.ppt
Β 
neural.ppt
neural.pptneural.ppt
neural.ppt
Β 
neural (1).ppt
neural (1).pptneural (1).ppt
neural (1).ppt
Β 
neural.ppt
neural.pptneural.ppt
neural.ppt
Β 
neural.ppt
neural.pptneural.ppt
neural.ppt
Β 
2.5 backpropagation
2.5 backpropagation2.5 backpropagation
2.5 backpropagation
Β 
Artificial Neural Networks
Artificial Neural NetworksArtificial Neural Networks
Artificial Neural Networks
Β 
Soft Computering Technics - Unit2
Soft Computering Technics - Unit2Soft Computering Technics - Unit2
Soft Computering Technics - Unit2
Β 
Multilayer Perceptron - Elisa Sayrol - UPC Barcelona 2018
Multilayer Perceptron - Elisa Sayrol - UPC Barcelona 2018Multilayer Perceptron - Elisa Sayrol - UPC Barcelona 2018
Multilayer Perceptron - Elisa Sayrol - UPC Barcelona 2018
Β 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
Β 
Max net
Max netMax net
Max net
Β 
SOFT COMPUTERING TECHNICS -Unit 1
SOFT COMPUTERING TECHNICS -Unit 1SOFT COMPUTERING TECHNICS -Unit 1
SOFT COMPUTERING TECHNICS -Unit 1
Β 
CS767_Lecture_05.pptx
CS767_Lecture_05.pptxCS767_Lecture_05.pptx
CS767_Lecture_05.pptx
Β 
Multilayer Backpropagation Neural Networks for Implementation of Logic Gates
Multilayer Backpropagation Neural Networks for Implementation of Logic GatesMultilayer Backpropagation Neural Networks for Implementation of Logic Gates
Multilayer Backpropagation Neural Networks for Implementation of Logic Gates
Β 
Neural Networks
Neural NetworksNeural Networks
Neural Networks
Β 
Neural_N_Problems - SLP.pdf
Neural_N_Problems - SLP.pdfNeural_N_Problems - SLP.pdf
Neural_N_Problems - SLP.pdf
Β 
Neurvvvvvvvvvvvvvvvvvvvval Networks.pptx
Neurvvvvvvvvvvvvvvvvvvvval Networks.pptxNeurvvvvvvvvvvvvvvvvvvvval Networks.pptx
Neurvvvvvvvvvvvvvvvvvvvval Networks.pptx
Β 
Unsupervised-learning.ppt
Unsupervised-learning.pptUnsupervised-learning.ppt
Unsupervised-learning.ppt
Β 

Recently uploaded

Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
Β 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
Β 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxTanveerAhmed817946
Β 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
Β 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationBoston Institute of Analytics
Β 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
Β 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
Β 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
Β 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...Suhani Kapoor
Β 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
Β 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
Β 
Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
Β 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
Β 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
Β 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
Β 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
Β 
Delhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip Callshivangimorya083
Β 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
Β 

Recently uploaded (20)

Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Β 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Β 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
Β 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptx
Β 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
Β 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Β 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
Β 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Β 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
Β 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
Β 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
Β 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
Β 
Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night πŸ₯΅ Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Β 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
Β 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Β 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
Β 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
Β 
Delhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 β˜Žβœ”πŸ‘Œβœ” Whatsapp Hard And Sexy Vip Call
Β 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
Β 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Β 

Classification using perceptron.pptx

  • 2. Agenda 1. Machine Learning Definition. 2. Types of machine learning. 3. Classification Definition. 4. Classification Algorithms. 5. Components of learning. 6. Neural Network. 7. Single layer perceptron. Feed Forward Neural Network 2
  • 3. What is machine learning? Definition of Machine Learning from WhatIS.com β€œis a type of artificial intelligence (AI) that allows software applications to become more accurate in predicting outcomes without being explicitly programmed”. Definition of Machine Learning from dictionary.com β€œThe ability of a machine to improve its performance based on previous results.” Feed Forward Neural Network 3
  • 4. Types of machine Learning Machine learning categorization Supervised Learning UnSupervised Learning Enforcement Learning Regression / classification clustering Feed Forward Neural Network 4
  • 5. Supervised Learning β€œClassification” οƒ˜In machine learning and statistics, classification is a supervised learning approach in which the computer program learns from the data input given to it and then uses this learning to classify new observation. ? Feed Forward Neural Network 5
  • 6. Classification algorithms: 1. Logistic Regression. 2. NaΓ―ve Bayes. 3. K-Nearest Neighbors. 4. Decision Tree. 5. Support Vector Machine. 6. Neural Network. Feed Forward Neural Network 6
  • 7. Components of learning β€’ Example:-Suppose that you are a bank manger and you want to predict your customers behavior in the future according to their historical data in order to make a credit card for money withdrawing or not (approve it or deny). 23 years Age Male Gender $30,000 Annual Salary 1 Year Years in residence 1 Year Years in job $ 15,000 Current debt Sample of data vector Feed Forward Neural Network 7
  • 8. Components of learning cont. β€’ Formalization:- β€’ Input : x (vector of data β€˜Customer Application’). β€’ Output : y (good/bad customer). β€’ Target Function : 𝒇: 𝒙 β†’ π’š (ideal credit approval formula). β€œit is unknown function as if it known we don’t need to learn the machine and just go ahead and implement our algorithm”. β€’ Data : π’™πŸ, π’šπŸ , π’™πŸ, π’šπŸ , … 𝒙𝒏, π’šπ’ (Historical data) β€’ Hypothesis: g: 𝒙 β†’ π’š β€’ we will use the historical data above in order to get the hypothesis which is the formal name we are going to call the formula we get. Feed Forward Neural Network 8
  • 9. Components of learning cont. ideal credit approval formula Historical records of credit customers Learning Algorithm Unknown target function 𝒇: 𝒙 β†’ π’š Training Example π’™πŸ, π’šπŸ , π’™πŸ, π’šπŸ , … 𝒙𝒏, π’šπ’ Final Hypothesis π’ˆ β‰ˆ 𝒇 Hypothesis Set 𝑯 Set of candidate formula Final credit Approval formula Both of them are called β€œLearning Model” Feed Forward Neural Network 9
  • 10. β€’ For input 𝑿 = (π’™πŸ, π’™πŸ, π’™πŸ‘ , … , 𝒙𝒏) β€˜Attributes of the customer’ Approve credit if π’Š=𝟏 𝒏 wixi > 𝒕𝒉𝒓𝒆𝒔𝒐𝒍𝒅 Deny credit if π’Š=𝟏 𝒏 wixi < 𝒕𝒉𝒓𝒆𝒔𝒐𝒍𝒅 So β„Ž π‘₯ = 𝑠𝑖𝑔𝑛(( π’Š=𝟏 𝒏 wixi )- threshold)) A simple hypothesis β€œThe perceptron” Feed Forward Neural Network 10
  • 11. A simple hypothesis β€œThe perceptron” cont. β€’ β„Ž π‘₯ = 𝑠𝑖𝑔𝑛(( π’Š=𝟏 𝒏 wixi )- threshold)) β€’ β„Ž π‘₯ = 𝑠𝑖𝑔𝑛(( π’Š=𝟏 𝒏 wixi ) + w0 )) β€’ β„Ž π‘₯ = 𝑠𝑖𝑔𝑛( π’Š=𝟎 𝒏 wixi ) Why W0 in order to get the following formula by introducing an artificial coordinate or vector called the bias x0=1 Feed Forward Neural Network 11
  • 12. Neural Network β€œsingle layer perceptron” β€’ is a system that is based on the biological neural network, such as the brain. The brain has approximately 100 billion neurons, which communicate through electro-chemical signals. β€’ Each neuron receives thousands of connections with other neurons, constantly receiving incoming signals to reach the cell body. β€’ If the resulting sum of the signals surpasses a certain threshold, a response is sent through the axon. Feed Forward Neural Network 12
  • 13. Neural Network β€œsingle layer perceptron”cont. β€’ is comprised of a network of artificial neurons (also known as "nodes"). β€’ These nodes are connected to each other, and the strength of their connections to one another is assigned a value based on their strength: inhibition (maximum being -1.0 week connection) or excitation (maximum being +1.0 strong connection) we call them weights. β€’ Three types of nodes: β€’ Input nodes. β€’ Hidden nodes. β€’ Output nodes. Feed Forward Neural Network 13
  • 14. Neural Network β€œsingle layer perceptron”cont. β€’ There are two types of neural network: 1. Single layer neural network β€œPerceptron”. 2. Multilayer neural network. Feed Forward Neural Network 14
  • 15. Neural Network β€œsingle layer perceptron”cont. Algorithm steps: 1. Start with the first sample.(Note: initial weights = 0) 2. Calculate Net = π’Š=𝟎 𝒏 wixi . EX:- Net = w1x1 + w2x2 + w0x0 Where x0 is a feature vector used to reduce number of iterations to get the optimal line that used to separate the data it is called β€œBias” its initial value =1. 3. Calculate f(Net) : which is called : 1. Transfer function. 2. Activation function. Ex :- F(Net) = 1 𝑁𝑒𝑑 β‰₯ 0 0 𝑁𝑒𝑑 < 0 4. If Output = Desired then go to next sample. else Output β‰  Desired Update weights then go to next sample. 5. Terminate step: find weights correct to all samples: βˆ†wi= Ξ· * ( Desired – Output) * xi βˆ†w = New weight - Old weight New Weight = βˆ†w + Old Weight Ξ· is called learning rate β€œEta” used also to reduce number of iterations especially during weights updating initially = 1 Feed Forward Neural Network 15
  • 16. Example :Single Layer Perceptron β€’ Consider the following training data set: 1. Is the problem solvably ?Why?! 2. If it is solvable find weights using perceptron single layer? Given : F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0 1. Classify the following samples: 1. (-2.0) . 2. (1,1). 3. (0,1). 4. (-1,-2). Desired x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 Ξ·=1 Feed Forward Neural Network 16
  • 17. Example :Single Layer Perceptron cont. Solution 1. The problem can be solved because it has only two classes (1, -1) ,so it can be solved using single layer perceptron. 2. The problem can be solved using tow ways: 1. Using Graph : Represent the data set points on x and y and find separable line between those two classes. π‘¦βˆ’y1 π‘₯βˆ’x1 = y2βˆ’y1 x2βˆ’x1  π‘¦βˆ’ 1 π‘₯+0.5 = βˆ’1βˆ’1 βˆ’0.5+0.5 π‘¦βˆ’ 1 π‘₯+0.5 = βˆ’2 0  -2x-1 = 0y  -2 x - 0y - 1 =0 w1x1 + w2x2 + w0x0 so w1 =-2 , w2 =0 , w0 =-1 -1 -2 1 2 -1 -2 1 2 (-0.5,1) (-0.5,-1) (-0.5,1) (-0.5,-1) (x2, y2) (x1, y1) Feed Forward Neural Network 17
  • 18. Example :Single Layer Perceptron cont. 2. Using perceptron : 1. Take the first sample, and initialize all weights to zero: 2. Calculate Net = π’Š=𝟎 𝒏 wixi = 0*1 + 0*-1 + 0*1 = 0 f(Net) = -1 3. while f(net) β‰  desired so update weights and go to next sample 4. βˆ†w0= Ξ· * ( Desired – Output) * xi = 1*(1+1)*1 =2 w0new = βˆ†w0+ wold = 2 + 0 = 2 βˆ†w1= Ξ· * ( Desired – Output) * xi = 1*(1+1)*-1 =-2 w1new = βˆ†w1+ wold = -2 + 0 = -2 βˆ†w2= Ξ· * ( Desired – Output) * xi = 1*(1+1)*1 =2 w2new = βˆ†w2+ wold = 2 + 0 = 2  go to next sample W2 = 0 W1 = 0 W0 = 0 x2 = 1 x1 = -1 x0 = 1 y x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 Feed Forward Neural Network 18 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 19. Example :Single Layer Perceptron cont. 1. Take the Second sample, and initialize all weights to zero: 2. Calculate Net = π’Š=𝟎 𝒏 wixi = 2*1 + -2*0 + 2*1 = 4 f(Net) = 1 3. while f(net) β‰  desired so update weights and go to next sample 4. βˆ†w0= Ξ· * ( Desired – Output) * xi = 1*(-1-1)*1 =-2 w0new = βˆ†w0+ wold = -2 + 2 = 0 βˆ†w1= Ξ· * ( Desired – Output) * xi = 1*(-1-1)*0 =0 w1new = βˆ†w1+ wold = 0 -2 = -2 βˆ†w2= Ξ· * ( Desired – Output) * xi = 1*(-1-1)*1 =-2 w2new = βˆ†w2+ wold = -2 +2 = 0  go to next sample W2 = 2 W1 = -2 W0 = 2 x2 = 1 x1 = 0 x0 = 1 y x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 Feed Forward Neural Network 19 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 20. Example :Single Layer Perceptron cont. 1. Take the third sample, and initialize all weights to zero: 2. Calculate Net = π’Š=𝟎 𝒏 wixi = 0*1 + -2*-1 + 0*-1 = 2 f(Net) = 1 3. while f(net) = desired so keep weights as they are and go to next sample W2 = 0 W1 = -2 W0 = 0 x2 = -1 x1 = -1 x0 = 1 y x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 Feed Forward Neural Network 20 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 21. Example :Single Layer Perceptron cont. 1. Take the fourth sample, and initialize all weights to zero: 2. Calculate Net = π’Š=𝟎 𝒏 wixi = 0*1 + -2*0 + 0*-1 = 0 f(Net) = -1 3. while f(net) = desired so keep weights as they are and go to next sample W2 = 0 W1 = -2 W0 = 0 x2 = -1 x1 = 0 x0 = 1 y x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 Feed Forward Neural Network 21 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 22. Example :Single Layer Perceptron cont. 1. Back again to the first sample, and initialize all weights to zero: 2. Calculate Net = π’Š=𝟎 𝒏 wixi = 0*1 + -2*-1 + 0*1 = 2 f(Net) = 1 3. while f(net) = desired so keep weights as they are and go to next sample W2 = 0 W1 = -2 W0 = 0 x2 = 1 x1 = -1 x0 = 1 y x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 Feed Forward Neural Network 22 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 23. Example :Single Layer Perceptron cont. 1. Back again to the first sample, and initialize all weights to zero: 2. Calculate Net = π’Š=𝟎 𝒏 wixi = 0*1 + -2*0 + 0*1 = 0 f(Net) = -1 3. while f(net) = desired so keep weights as they are and go to next sample so the weighs used for this set is W2 = 0 W1 = -2 W0 = 0 x2 = 1 x1 = 0 x0 = 1 y x2 X1 x0 1 1 -1 1 -1 1 0 1 1 -1 -1 1 -1 -1 0 1 W2 = 0 W1 = -2 W0 = 0 Feed Forward Neural Network 23 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 24. Example :Single Layer Perceptron cont. 3. (-2, 0) = 𝐒=𝟎 𝐧 wixi = 0*1 + -2*-2 + 0*0 = 4 f(Net) = 1 so it is classified as class 1 (1, 1) = 𝐒=𝟎 𝐧 wixi = 0*1 + 1*-2 + 1*0 = -2 f(Net) = 1 so it is classified as class -1 (0, 1) = 𝐒=𝟎 𝐧 wixi = 0*1 + 0*-2 + 0*1 = 0 f(Net) = 1 so it is classified as class -1 (-1, -2) = 𝐒=𝟎 𝐧 wixi = 0*1 + -2*-1 + 0*-2 = 2 f(Net) = 1 so it is classified as class 1 Feed Forward Neural Network 24 F(Net) = 1 𝑁𝑒𝑑 > 0 βˆ’1 𝑁𝑒𝑑 ≀ 0
  • 25. Perceprton implementation using matlab Feed Forward Neural Network 25
  • 26. Simple Run using previous code Step 1 : initialize input Step 2 : initialize output Step 3 : Call the function Step 4 : testing sample Feed Forward Neural Network 26
  • 27. The End Feed Forward Neural Network 27