Dataset –
ID  Name  Gender  Height  Class 

1  A  F  1.6  short 
2  B  M  2  tall 
3  C  F  1.9  medium 
4  D  F  1.85  medium 
5  E  M  2.8  tall 
6  F  M  1.7  short 
7  G  M  1.8  medium 
8  H  F  1.6  short 
9  I  F  1.65  short 
Find probability of class attribute –
\(P(short) = \frac{4}{9}\)
\(P(medium) = \frac{3}{9}\)
\(P(tall) = \frac{2}{9}\)
Working Table –
Attribute  Value (Short) 
Value (Medium) 
Value (Tall) 
Probability (Short) 
Probability (Medium) 
Probability (Tall) 


Gender  Male  
Female  
Height  [0 1.6]  
[1.61 – 1.7]  
[1.71 – 1.8]  
[1.81 – 1.9]  
[1.91 – 2.0]  
[2.0 – ∞] 
Filling the table
Attribute  Value (Short) 
Value (Medium) 
Value (Tall) 
Probability (Short) 
Probability (Medium) 
Probability (Tall) 


Gender  Male  1  1  2  0.25  0.333  1 
Female  3  2  0  0.75  0.667  0 
Solution –
Attribute  Value (Short) 
Value (Medium) 
Value (Tall) 
Probability (Short) 
Probability (Medium) 
Probability (Tall) 


Gender  Male  1  1  2  1/4  1/3  2/2 
Female  3  2  0  3/4  2/3  0  
Height  [0 – 1.6]  2  0  0  2/4  0  0 
[1.61 – 1.7]  2  0  0  2/4  0  0  
[1.71 – 1.8]  0  1  0  0  1/3  0  
[1.81 – 1.9]  0  2  0  0  2/3  0  
[1.91 – 2]  0  0  1  0  0  1/2  
[2.1 – ∞]  0  0  1  0  0  1/2 
Using Bayesian classification and given data, classify the following set –
\(t = \{Hola, M, 2.2\}\)
Step 1: Find probability for each class
\(P(tshort) = P(mshort) \times P(2.1 ∞short) = \frac{1}{4} \times 0 = 0\)
\(P(tmedium) = P(mshort) \times P(2.1 ∞medium) = \frac{1}{4} \times 0 = 0\)
\(P(ttall) = P(mshort) \times P(2.1 ∞tall) = \frac{2}{2} \times \frac{1}{2} = 0.5 =
\frac{1}{2}\)
Step 2: Finding likelyhood of occurence –
\(L(short) = P(tshort) \times p(short) = 0 \times \frac{4}{9} = 0\)
\(L(medium) = P(tmedium) \times p(medium) = 0 \times \frac{3}{9} = 0\)
\(L(tall) = P(ttall) \times p(tall) = \frac{1}{2} \times \frac{2}{9} = \frac{2}{18} =
0.11\)
\(Estimate = p(t) = 0 + 0 + 0.11 = 0.11\)
Bayes Theorem –
\(P(x/y) = (P(y/x) \times P(x))/P(y)\)
Step 3: Find final probability
\(P(shortt) = \frac{(P(tshort) \times P(short)}{P(t)} = \frac{0 \times \frac{4}{9}}{0.11} = 0\)
\(P(mediumt) = \frac{P(tmedium) \times P(medium)}{P(t)} = \frac{0 \times \frac{3}{9}}{0.11} = 0\)
\(P(tallt) = \frac{P(ttall) \times P(tall)}{P(t)} = \frac{\frac{1}{2} \times \frac{2}{9}}{0.11} = 1\)