Unit-4
Unit-4
=2
=2(x-2)
= 2(1.5-2)=
Naive Bayes: A simple and effective algorithm that uses conditional probability and prior
probabilities to make predictions
Decision tree techniques: Can be used for multiclass classification
Logistic regression: Can be used for multiclass classification
Neural networks: Can be used for multiclass classification
SVM: Can be used for multiclass classification
Naive Bayes
Naive Bayes classifiers are a collection of classification algorithms based on Bayes’
Theorem. It is not a single algorithm but a family of algorithms where all of them share a
common principle, i.e. every pair of features being classified is independent of each other. To
start with, let us consider a dataset.
The dataset is divided into two parts, namely, feature matrix and the response vector.
•Feature matrix contains all the vectors(rows) of dataset in which each vector consists of
the value of dependent features. In above dataset, features are ‘Outlook’, ‘Temperature’,
‘Humidity’ and ‘Windy’.
•Response vector contains the value of class variable(prediction or output) for each row
of feature matrix. In above dataset, the class variable name is ‘Play golf’.
Temperature Humidity Windy Play Golf
Outlook
0 Rainy Hot High False No
1 Rainy Hot High True No
2 Overcast Hot High False Yes
3 Sunny Mild High False Yes
4 Sunny Cool Normal False Yes
5 Sunny Cool Normal True No
6 Overcast Cool Normal True Yes
7 Rainy Mild High False No
8 Rainy Cool Normal False Yes
9 Sunny Mild Normal False Yes
10 Rainy Mild Normal True Yes
11 Overcast Mild High True Yes
12 Overcast Hot Normal False Yes
13 Sunny Mild High True No
Bayes’ Theorem finds the probability of an event occurring given the probability of another
event that has already occurred. Bayes’ theorem is stated mathematically as the following
equation:
•asically, we are trying to find probability of event A, given the event B is true. Event B is
also termed as evidence.
•P(A) is the priori of A (the prior probability, i.e. Probability of event before evidence is
seen). The evidence is an attribute value of an unknown instance(here, it is event B).
•P(B) is Marginal Probability: Probability of Evidence.
•P(A|B) is a posteriori probability of B, i.e. probability of event after evidence is seen.
•P(B|A) is Likelihood probability i.e the likelihood that a hypothesis will come true based on
the evidence.