SlideShare a Scribd company logo
1 of 33
Download to read offline
Computational Cognitive Science
CCS
Lecture 5
• Sayed Hussein Haggag, PhD
• email: sshaggag08@gmail.com
• Maximum a posteriori (MAP)
• Learning Naive Bayes Model
• Naive Bayes model accuracy
• Gaussian Naive Bayes
Maximum a posteriori (MAP)
• You can see that we are interested in calculating the posterior probability of
P(h|d) from p(h) with P(D) and P(d|h). After calculating the posterior
probability for a number of different hypotheses, you can select the
hypothesis with the highest probability.
• This is the maximum probable hypothesis and may formally be called the
maximum a posteriori (MAP) hypothesis. This can be written as:
Representation Used By Naive Bayes Models
• The representation for naive Bayes is probabilities. A list
of probabilities is stored to file for a learned naive Bayes
model. This includes:
Learning a Naive Bayes Model From Data
• Learning a naive Bayes model from your training data is
fast.
• Training is fast because only the probability of each class
and the probability of each class given different input data
(x) values need to be calculated.
• No coefficients need to be fitted by optimization
procedures.
Calculating Class Probabilities
• The class probabilities are simply the frequency of
instances that belong to each class divided by the total
number of instances. For example in a binary
classification the probability of an instance belonging to
class 1 would be calculated as:
Calculating Conditional Probabilities
• The conditional probabilities are the frequency of each attribute value for a
given class value divided by the frequency of instances with that class value.
For example, if a weather attribute had the values sunny and rainy and the
class attribute had the class values go-out and stay-home, then the
conditional probabilities of each weather value for each class value could be
calculated as:
• Where ∧ means conjunction (and)
Make Predictions With a Naive Bayes Model
• Given a naive Bayes model, you can make predictions for
new data using Bayes theorem:
MAP(h) = max(P(d|h) × P(h))
Using our example above, if we had a new instance with the weather of sunny,
we can calculate:
go-out = P(weather = sunny|class = go-out) × P(class = go-out)
stay-home = P(weather = sunny|class = stay-home) × P(class = stay-home)
• If we had more input variables we could extend the above example. For
example, assume we have a car attribute with the values working and broken.
We can multiply this probability into the equation. For example below is the
calculation for the go-out class label with the addition of the car input variable
set to working:
• go-out =P(weather = sunny|class = go-out)×P(car = working|class = go-out)× P(class = go-out)
Dataset
Weather Car Class
sunny working go-out
rainy broken go-out
sunny working go-out
sunny working go-out
sunny working go-out
rainy broken stay-home
rainy broken stay-home
sunny working stay-home
sunny broken stay-home
rainy broken stay-home
• we can directly compute the probabilities, or
• We can convert this into numbers. Each input has only
two values and the output class variable has two values.
We can convert each variable to binary as follows:
• Weather: sunny = 1, rainy = 0
• Car: working = 1, broken = 0
• Class: go-out = 1, stay-home = 0
Simplification for the dataset
• again we just need to find
– class prob.
– conditional prob.
• The class probabilities are equal (balanced) in this
example
• P(class = 1) = 5
5+5
= 0.5
• P(class = 0) = 5
5+5
= 0.5
Calculate the Conditional Probabilities
P(weather = sunny|class = go-out) = 0.8
P(weather = rainy|class = go-out) = 0.2
P(weather = sunny|class = stay-home) = 0.4
P(weather = rainy|class = stay-home) = 0.6
“Car” Input Variable
P(car = working|class = go-out) = 0.8
P(car = broken|class = go-out) = 0.2
P(car = working|class = stay-home) = 0.2
P(car = broken|class = stay-home) = 0.8
• We now have every thing we need to make predictions using the Naive
Bayes model.
• Let’s take the first record from our dataset and use our learned model to
predict which class we think it belongs.
• First instance: weather = sunny, car = working.
go-out =P(weather = sunny|class = go-out)× P(car = working|class = go-out)×P(class = go-out)
go-out = 0.8 × 0.8 × 0.5=0.32
for the stay-home case:
stay-home =P(weather = sunny|class = stay-home)×P(car = working|class = stay-home)×P(class = stay-home)
stay-home = 0.4 × 0.2 × 0.5=0.04
0.32 is greater than 0.04, therefore we predict go-out for this instance
• Now, we can repeat for every probable combination in the
dataset
Model accuracy computation
• If we tabulate the predictions compared to the actual class values as shown, we get an
accuracy of 80%, which is excellent given that there are conflicting examples in the dataset
• Notes
– the accuracy here is computed for the given dataset
– If the dataset is large enough, you can divide it into training and
testing datasets
– and then find the accuracy using the testing dataset.
Gaussian Naive Bayes
• Naive Bayes can be extended to real-valued attributes, most
commonly by assuming a Gaussian distribution. This extension of
Naive Bayes is called Gaussian Naive Bayes.
• Other functions can be used to estimate the distribution of the
data
Representation for Gaussian Naive Bayes
• Above, we calculated the probabilities for input values for
each class using a frequency. With real-valued inputs, we
can calculate the mean and standard deviation of input
values (x) for each class to summarize the distribution.
This means that in addition to the probabilities for each
class, we must also store the mean and standard
deviations for each input variable for each class.
Learning a Gaussian Naive Bayes Model From Data
• Each class here is represented by its mean and SD
parameters of its Gaussian distribution.
• Each class has different parameters.
Preparing Data For Naive Bayes
• Categorical Inputs: Naive Bayes assumes label attributes such as binary, categorical or nominal.
• Gaussian Inputs: If the input variables are real-valued, a Gaussian distribution is assumed. In which
case the algorithm will perform better if the uni variate distributions of your data are Gaussian or near-
Gaussian. This may require removing outliers (e.g. values that are more than 3 or 4 standard
deviations from the mean).
• Classification Problems: Naive Bayes is a classification algorithm suitable for binary and multi-class
classification.
• Log Probabilities: The calculation of the likelihood of different class values involves multiplying a lot
of small numbers together. his can lead to an underflow of numerical precision. As such it is good
practice to use a log transform of the probabilities to avoid this underflow.
• Kernel Functions: Rather than assuming a Gaussian distribution for numerical input values, more
complex distributions can be used such as a variety of kernel density functions.
• Update Probabilities: When new data becomes available, you can simply update the probabilities of
your model. This can be helpful if the data changes frequently.
• A simple dataset was contrived for our purposes. It is comprised of two input
variables X1 and X2 and one output variable Y . The input variables are
drawn from a Gaussian distribution, which is one assumption made by
Gaussian Naive Bayes. The class variable has two values, 0 and 1, therefore
the problem is a binary classification problem.
• Data from class 0 was drawn randomly from a Gaussian distribution with a
standard deviation of 1.0 for X1 and X2. Data from class 1 was drawn
randomly from a Gaussian distribution with a mean of 7.5 for X1 and 2.5 for
X2. This means that the classes are nicely separated if we plot the input data
on a scatter plot.
• The raw dataset is listed below:
Gaussian data
pdf(x/ mean, sd)
for example
when the
mean=0
sd=1
Learn The Model
• we need class probabilities
it equals P(Y = 0)=P(Y = 1) 0.5
• Conditional Probabilities
P(X1|Y = 0), P(X1|Y = 1)
P(X2|Y = 0), P(X2|Y = 1)
To make predictions with this model
• Let’s test the first value
• X1 = 3.393533211, X2 = 2.331273381, Y = 0
class 0 = P(pdf(X1)|class = 0) × P(pdf(X2)|class = 0) × P(class = 0)
class 0 = 0.358838152 × 0.272650889 × 0.5= 0.048918771
class 1 = P(pdf(X1)|class = 1) × P(pdf(X2)|class = 1) × P(class = 1)
class 1 = 4.10796E −7 × 0.173039018 × 0.5 = 3.55418E − 08
So the model predicts that the class is zero
We can repeat for all the values
Other kernel functions
• Instead of Gaussian
• You can use other distributions (if given), for example
– Exponential distribution
�(�/�����) = ��−��
���� =��=
�
�
-In general, The choice of the kernel depends on data
nature.
Thanks

More Related Content

Similar to lecture 5 about lecture 5 about lecture lecture

Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos
butest
 

Similar to lecture 5 about lecture 5 about lecture lecture (20)

UNIT2_NaiveBayes algorithms used in machine learning
UNIT2_NaiveBayes algorithms used in machine learningUNIT2_NaiveBayes algorithms used in machine learning
UNIT2_NaiveBayes algorithms used in machine learning
 
Model Selection and Validation
Model Selection and ValidationModel Selection and Validation
Model Selection and Validation
 
Supervised models
Supervised modelsSupervised models
Supervised models
 
Domain adaptation: A Theoretical View
Domain adaptation: A Theoretical ViewDomain adaptation: A Theoretical View
Domain adaptation: A Theoretical View
 
Supervised algorithms
Supervised algorithmsSupervised algorithms
Supervised algorithms
 
Unit-2 Bayes Decision Theory.pptx
Unit-2 Bayes Decision Theory.pptxUnit-2 Bayes Decision Theory.pptx
Unit-2 Bayes Decision Theory.pptx
 
ngboost.pptx
ngboost.pptxngboost.pptx
ngboost.pptx
 
Naive.pdf
Naive.pdfNaive.pdf
Naive.pdf
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learning
 
Normalizing flow
Normalizing flowNormalizing flow
Normalizing flow
 
-BayesianLearning in machine Learning 12
-BayesianLearning in machine Learning 12-BayesianLearning in machine Learning 12
-BayesianLearning in machine Learning 12
 
Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
 
ngboost.pptx
ngboost.pptxngboost.pptx
ngboost.pptx
 
Bagging_and_Boosting.pptx
Bagging_and_Boosting.pptxBagging_and_Boosting.pptx
Bagging_and_Boosting.pptx
 
An introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using PythonAn introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using Python
 
Naïve Bayes.pptx
Naïve Bayes.pptxNaïve Bayes.pptx
Naïve Bayes.pptx
 
Machine learning naive bayes and svm.pdf
Machine learning naive bayes and svm.pdfMachine learning naive bayes and svm.pdf
Machine learning naive bayes and svm.pdf
 
Learn from Example and Learn Probabilistic Model
Learn from Example and Learn Probabilistic ModelLearn from Example and Learn Probabilistic Model
Learn from Example and Learn Probabilistic Model
 
naive bayes example.pdf
naive bayes example.pdfnaive bayes example.pdf
naive bayes example.pdf
 

Recently uploaded

Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 

lecture 5 about lecture 5 about lecture lecture

  • 2. • Sayed Hussein Haggag, PhD • email: sshaggag08@gmail.com
  • 3. • Maximum a posteriori (MAP) • Learning Naive Bayes Model • Naive Bayes model accuracy • Gaussian Naive Bayes
  • 4. Maximum a posteriori (MAP) • You can see that we are interested in calculating the posterior probability of P(h|d) from p(h) with P(D) and P(d|h). After calculating the posterior probability for a number of different hypotheses, you can select the hypothesis with the highest probability. • This is the maximum probable hypothesis and may formally be called the maximum a posteriori (MAP) hypothesis. This can be written as:
  • 5. Representation Used By Naive Bayes Models • The representation for naive Bayes is probabilities. A list of probabilities is stored to file for a learned naive Bayes model. This includes:
  • 6. Learning a Naive Bayes Model From Data • Learning a naive Bayes model from your training data is fast. • Training is fast because only the probability of each class and the probability of each class given different input data (x) values need to be calculated. • No coefficients need to be fitted by optimization procedures.
  • 7. Calculating Class Probabilities • The class probabilities are simply the frequency of instances that belong to each class divided by the total number of instances. For example in a binary classification the probability of an instance belonging to class 1 would be calculated as:
  • 8. Calculating Conditional Probabilities • The conditional probabilities are the frequency of each attribute value for a given class value divided by the frequency of instances with that class value. For example, if a weather attribute had the values sunny and rainy and the class attribute had the class values go-out and stay-home, then the conditional probabilities of each weather value for each class value could be calculated as: • Where ∧ means conjunction (and)
  • 9. Make Predictions With a Naive Bayes Model • Given a naive Bayes model, you can make predictions for new data using Bayes theorem: MAP(h) = max(P(d|h) × P(h)) Using our example above, if we had a new instance with the weather of sunny, we can calculate: go-out = P(weather = sunny|class = go-out) × P(class = go-out) stay-home = P(weather = sunny|class = stay-home) × P(class = stay-home)
  • 10. • If we had more input variables we could extend the above example. For example, assume we have a car attribute with the values working and broken. We can multiply this probability into the equation. For example below is the calculation for the go-out class label with the addition of the car input variable set to working: • go-out =P(weather = sunny|class = go-out)×P(car = working|class = go-out)× P(class = go-out)
  • 11. Dataset Weather Car Class sunny working go-out rainy broken go-out sunny working go-out sunny working go-out sunny working go-out rainy broken stay-home rainy broken stay-home sunny working stay-home sunny broken stay-home rainy broken stay-home
  • 12. • we can directly compute the probabilities, or • We can convert this into numbers. Each input has only two values and the output class variable has two values. We can convert each variable to binary as follows: • Weather: sunny = 1, rainy = 0 • Car: working = 1, broken = 0 • Class: go-out = 1, stay-home = 0
  • 14. • again we just need to find – class prob. – conditional prob. • The class probabilities are equal (balanced) in this example • P(class = 1) = 5 5+5 = 0.5 • P(class = 0) = 5 5+5 = 0.5
  • 15. Calculate the Conditional Probabilities P(weather = sunny|class = go-out) = 0.8 P(weather = rainy|class = go-out) = 0.2 P(weather = sunny|class = stay-home) = 0.4 P(weather = rainy|class = stay-home) = 0.6
  • 16. “Car” Input Variable P(car = working|class = go-out) = 0.8 P(car = broken|class = go-out) = 0.2 P(car = working|class = stay-home) = 0.2 P(car = broken|class = stay-home) = 0.8
  • 17. • We now have every thing we need to make predictions using the Naive Bayes model. • Let’s take the first record from our dataset and use our learned model to predict which class we think it belongs. • First instance: weather = sunny, car = working. go-out =P(weather = sunny|class = go-out)× P(car = working|class = go-out)×P(class = go-out) go-out = 0.8 × 0.8 × 0.5=0.32 for the stay-home case: stay-home =P(weather = sunny|class = stay-home)×P(car = working|class = stay-home)×P(class = stay-home) stay-home = 0.4 × 0.2 × 0.5=0.04 0.32 is greater than 0.04, therefore we predict go-out for this instance
  • 18. • Now, we can repeat for every probable combination in the dataset
  • 19. Model accuracy computation • If we tabulate the predictions compared to the actual class values as shown, we get an accuracy of 80%, which is excellent given that there are conflicting examples in the dataset
  • 20. • Notes – the accuracy here is computed for the given dataset – If the dataset is large enough, you can divide it into training and testing datasets – and then find the accuracy using the testing dataset.
  • 21. Gaussian Naive Bayes • Naive Bayes can be extended to real-valued attributes, most commonly by assuming a Gaussian distribution. This extension of Naive Bayes is called Gaussian Naive Bayes. • Other functions can be used to estimate the distribution of the data
  • 22. Representation for Gaussian Naive Bayes • Above, we calculated the probabilities for input values for each class using a frequency. With real-valued inputs, we can calculate the mean and standard deviation of input values (x) for each class to summarize the distribution. This means that in addition to the probabilities for each class, we must also store the mean and standard deviations for each input variable for each class.
  • 23. Learning a Gaussian Naive Bayes Model From Data
  • 24. • Each class here is represented by its mean and SD parameters of its Gaussian distribution. • Each class has different parameters.
  • 25. Preparing Data For Naive Bayes • Categorical Inputs: Naive Bayes assumes label attributes such as binary, categorical or nominal. • Gaussian Inputs: If the input variables are real-valued, a Gaussian distribution is assumed. In which case the algorithm will perform better if the uni variate distributions of your data are Gaussian or near- Gaussian. This may require removing outliers (e.g. values that are more than 3 or 4 standard deviations from the mean). • Classification Problems: Naive Bayes is a classification algorithm suitable for binary and multi-class classification. • Log Probabilities: The calculation of the likelihood of different class values involves multiplying a lot of small numbers together. his can lead to an underflow of numerical precision. As such it is good practice to use a log transform of the probabilities to avoid this underflow. • Kernel Functions: Rather than assuming a Gaussian distribution for numerical input values, more complex distributions can be used such as a variety of kernel density functions. • Update Probabilities: When new data becomes available, you can simply update the probabilities of your model. This can be helpful if the data changes frequently.
  • 26. • A simple dataset was contrived for our purposes. It is comprised of two input variables X1 and X2 and one output variable Y . The input variables are drawn from a Gaussian distribution, which is one assumption made by Gaussian Naive Bayes. The class variable has two values, 0 and 1, therefore the problem is a binary classification problem. • Data from class 0 was drawn randomly from a Gaussian distribution with a standard deviation of 1.0 for X1 and X2. Data from class 1 was drawn randomly from a Gaussian distribution with a mean of 7.5 for X1 and 2.5 for X2. This means that the classes are nicely separated if we plot the input data on a scatter plot. • The raw dataset is listed below:
  • 28. pdf(x/ mean, sd) for example when the mean=0 sd=1
  • 29. Learn The Model • we need class probabilities it equals P(Y = 0)=P(Y = 1) 0.5 • Conditional Probabilities P(X1|Y = 0), P(X1|Y = 1) P(X2|Y = 0), P(X2|Y = 1)
  • 30. To make predictions with this model • Let’s test the first value • X1 = 3.393533211, X2 = 2.331273381, Y = 0 class 0 = P(pdf(X1)|class = 0) × P(pdf(X2)|class = 0) × P(class = 0) class 0 = 0.358838152 × 0.272650889 × 0.5= 0.048918771 class 1 = P(pdf(X1)|class = 1) × P(pdf(X2)|class = 1) × P(class = 1) class 1 = 4.10796E −7 × 0.173039018 × 0.5 = 3.55418E − 08 So the model predicts that the class is zero
  • 31. We can repeat for all the values
  • 32. Other kernel functions • Instead of Gaussian • You can use other distributions (if given), for example – Exponential distribution �(�/�����) = ��−�� ���� =��= � � -In general, The choice of the kernel depends on data nature.