In: Computer Science
For this problem, use the e1-p3.csv dataset.
A1 |
A2 |
A3 |
Class |
low |
hot |
medium |
Y |
low |
mild |
large |
N |
low |
hot |
small |
N |
low |
cold |
medium |
N |
high |
cold |
small |
N |
high |
mild |
medium |
Y |
high |
cold |
large |
N |
low |
cold |
medium |
Y |
high |
mild |
large |
Y |
low |
mild |
large |
N |
high |
hot |
medium |
Y |
high |
cold |
large |
N |
low |
mild |
small |
Y |
low |
hot |
small |
N |
low |
hot |
medium |
N |
(1). Using the Naïve Bayes algorithm that we discussed in the class, classify the following unseen instance:
X = <A1 = high, A2 = hot, A3 = large>
You should not use Weka, JMP Pro, or any other data mining/machine learning software. You must show all intermediate results and calculations.
(2). Suppose that P(X) = 0.0667. Calculate P(Y | X) and P(N | X). You must show all intermediate results and calculations.
Hi,
First we should know the formula
Naive assumption : if any two events A and B and they are independent, then
P(A,B) = P(A) P(B)
Based on classes, we calculate the all conditional probabilties
Now, we pick up the output with maximum probability and which gives label of class and can be expressed as given below.
now comes to our question
In the above image, we are able to see that P(X|Y) has less probability than P(X|N) so P(X|N) will dominate P(X|Y)hence X intance will be labeled as "NO" .
----------------------------------------------------------------------------------------------------------------------------------------------------
Hope it helps..
Still if you have any doubt, please let me know in comment section and if you like, Please upvote.
Thank You !