You are on page 1of 3

ATDS

CONCEPTUAL QUESTION

Submitted to: Submitted by:


Dr. Sreekanth VK Niraj Soni
M180243MS
Question:
Apply Naïve Based algorithm in the given data to predict if the person will be having following
properties in it.
X = (Refund = No, Private Job, Salary = 120)

Employment
S. No. Refund type Salary Evade
1 Yes Govt. Job 125 No
2 No Private Job 100 No
3 No Govt. Job 70 No
4 Yes Private Job 120 No
5 No Business 95 Yes
6 No Private Job 60 No
7 Yes Business 220 No
8 No Govt. Job 85 Yes
9 No Private Job 75 No
10 No Govt. Job 90 Yes

Solution:
Normal Distribution is given as-
(𝐴𝑖 −𝜇𝑖𝑗 )2
1 −
2𝜎𝑖𝑗 2
𝑃(𝐴𝑖 | 𝑐𝑗 ) = e
√2𝜋𝜎𝑖𝑗 2
For (Income, Class =No)
If class is no:
• Sample mean = 110
• Sample Variance = 2975
• Sample SD = 54.54

1 (120−110)2

𝑃(𝐼𝑛𝑐𝑜𝑚𝑒 = 120 | 𝑁𝑜) = e 2(2975)
√2𝜋(54.54)2
= 0.0072
Naïve Bayes Classifier
X = (Refund = No, Private Job, Salary = 120)
P(Refund = Yes|No) = 3/7
P(Refund = No|No) = 4/7
P(Refund = Yes|Yes) = 0
P(Refund = No|Yes) = 1
P(Employment type = Govt. Job|No) = 2/7
P(Employment type = Business|No) =1/7
P(Employment type = Private Job|No) = 4/7
P(Employment type = Govt. Job|Yes) = 2/7
P(Employment type = Business|Yes) =1/7
P(Employment type = Private Job|Yes) = 0

For Salary:
If class=No: sample mean = 110
sample variance = 2975
If class=Yes: sample mean = 90

sample variance = 25

P(X|Class=No)
= P(Refund=No|Class=No) × P(Private Job| Class=No) × P(Salary=120| Class=No)
= 4/7 × 4/7 × 0.0072
= 0.0024

P(X|Class=Yes)
= P(Refund=No| Class=Yes) × P(Private Job| Class=Yes) × P(Salary=120| Class=Yes)
= 1 × 0 × 1.2 × 10-9 = 0

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


Therefore P(No|X) > P(Yes|X)

From the above solution we can say that the class will not get refund.

You might also like