Let $c_1$ $\rightarrow$ buys-comp = "yes"
$c_2$ $\rightarrow$ buys - comp = "xs"
- calculate class probabilities
p (1) = 9/4
p (2) = 5/14
- calculate p ( $c_1$ | x) = p (x| $c_1$) . p ($c_1$)
p (x | $c_1$) = $\frac{\gamma}{11} p (xk | c_1)$
$\therefore$ p ($x_1 | c_1)$ p (age = "young" / $c_1$)
= 2/9
p ($x_2/ c_1)$ = p (income = "med" / $c_1$)
= 4/9
p (x3 / $c_1$) = p (student = "yes" / $c_1$)
= 6/9
p (x4 / $c_1)$ = p ( c.r. = "fair" | $c_1$)
$\therefore$ 0 (x|$c_1$) = 2/9 4/9 6/9 6/9
$\therefore$ p ($c_1$/ x) = 2/9 4/9 6/9 6/9 9/14
= 0.0282
- Calculate p ($c_2
/x) = p( x| c_2) , p (c_2)$
p (x | $c_2) = \frac{\gamma}{11} p (x_k | c_2)$
k = 1
$\therefore$ p ($x_1 / c_2)$ = p ( age = "young" / $c_2$)
= 3/6
$p (x_2 / c_2 = p (income = " " / c_2 $)
= 2/6
$p ( x_3 / c_2)$ = p (student = "yes" / $c_2)$
= 1/6
p ($x_4 / c_2 $) = p $(c_1$ = "fair" / $c_2$)
= 2/6
$\therefore$ p (x / $c_2$)
= 3/1 2/0 1/6 2/6
$\therefore$ p ( $c_2$ / x) = 3/6 2/6 1/6 2/6 6/14
= 0.0036
$\because$ p ($c_1$ / x) > p ($c_2$/ x)
X E C,
$\therefore$ x E bays - comp = "yes"