You are on page 1of 4

(b) How can the various prior probabilities used in Naive boys Classifier can be calculation from the

training data

Ans:- Training Data

Tid Refund Marital Status TaxableIncome Evade

1. Yes Single 125k No

2. No Married 100k No

3. No Single 70k No

4. Yes Married 120k No

5. No Divorced 95k Yes

6. No Married 60k No

7. Yes Divorced 220k No

8. No Single 85k Yes

9. No Married 75k No

10. No Single 90k Yes

If we consider, X= (Refund = No, Divorced ,Income =102k)

Then,

P(X/yes) = P(Refund = No/ Yes) X P(Divorced ? Yes) X P(Income = 20K / Yes)

3 1
= X X p(Income +120k/Yes)
3 3
In the above value of Taxable income, it is in continuous data. So, we to find
2
1 ( xi−µij)
P(Income = 120k / Yes) = 2 i
√2 π (σ ij) 2 µ ¿ ¿ ¿
By the formula,

1
2
σ =
n−1
∑ ¿ ¿)2
1
= [(95-90)2+(85 -902) +(90 -90)2 ]
(3−1)

= ½ [25-25]

½ X50 = 25

Now, σ 2 value is complete to,


2
1 −(120−920)
P( Income = 120k / yes) = i
√2 π (25) 2(25)

1
= i−¿ 900/50 ¿
√2 π (5)
= 1.2 X 10-9

Finally, we can calculate P (X/ Yes)

P(X/ Yes) = 3/3 X 1/3 X 1.2 X 10-4

=4 X 10-10

= 0.8731

Similarly , P(X/ No) = P(refund – No/No) X P(Divorced ? No)

= 4/7 X 1/7 X 0.0072

=0.0006

Since P(X/No)P(No)>P(X/Yes)>P(X/Yes)P(Yes)

Therefore

P(No/X) > P(Yes/X)

=> Class = No
From the give3n traini9ng data, we can also find the following probability in a simple way.

P(Refund = Yes/ No) = 3/7 P(Yes) = 3/10

P(Refund = No/ No) = 4/7 P(Yes) = 7/10


P(Refund = Yes/ Yes) = 0
P(Refund = Yes/ No) = 1

P(Marital Status = Single / No)= 2/7


P(Refund = Divorced/No) = 1/7
P (Single / Yes) = 2/3
P(Married/ No) = 4/7
P(Divorced / Yes) =1/3
P(Married / Yes) = 0
Now, we can find also P(yes / Divorced)
P(Yes / Divorced )= 1/3 X 3/10 (Divorced)
=1/3 X3/10 / 1/5
=0.5
Similarly,
P(No/Divorced) = 1/7 X 7/10 (P(Divorced))
If we also know that the refund = No, then
P(Yes/ Refund = No, Divorced)
=1X 1/3 X3/10 /P(Divorced, Refund = No)

If we also know that taxable Income = 120


Then,
P(yes/ refund = No, Divorced, income = 120 / Yes)X
P(Refund = No, Divorced, Refund = No, income = 120)
= 1.2 X 10-9 X 1/3 X 3/10 / P( Divorced, Refund No, Income =120)
Similarly,
P(refund = No, Divorced, Income = 120)
=P(No) / p (Divorced, Refund = No, Income = 120)
=0.0072 X 4X 7X 7/10 / P (Divorced, Refund = No, Income =120)

You might also like