Page 102 - Demo
P. 102
%u062c%u0645%u064a%u0639 %u0627%u0644%u062d%u0642%u0648%u0642 %u0645%u062d%u0641%u0648%u0638%u0629 %u0640 %u0627%u0625%u0644%u0639%u062a%u062f%u0627%u0621 %u0639%u0649%u0644 %u062d%u0642 %u0627%u0645%u0644%u0624%u0644%u0641 %u0628%u0627%u0644%u0646%u0633%u062e %u0623%u0648 %u0627%u0644%u0637%u0628%u0627%u0639%u0629 %u064a%u0639%u0631%u0636 %u0641%u0627%u0639%u0644%u0647 %u0644%u0644%u0645%u0633%u0627%u0626%u0644%u0629 %u0627%u0644%u0642%u0627%u0646%u0648%u0646%u064a%u0629102Class: C1:buys_computer = %u2018yes%u2019 C2:buys_computer = %u2018no%u2019 Data to be classified: X = (age <=30, Income = medium, Student = yes Credit_rating = Fair) P(Ci): P(buys_computer = %u201cyes%u201d) = 9/14 = 0.643 P(buys_computer = %u201cno%u201d) = 5/14= 0.357 Compute P(X|Ci) for each class P(age = %u201c<=30%u201d | buys_computer = %u201cyes%u201d) = 2/9 = 0.222 P(age = %u201c<= 30%u201d | buys_computer = %u201cno%u201d) = 3/5 = 0.6 P(income = %u201cmedium%u201d | buys_computer = %u201cyes%u201d) = 4/9 = 0.444 P(income = %u201cmedium%u201d | buys_computer = %u201cno%u201d) = 2/5 = 0.4 P(student = %u201cyes%u201d | buys_computer = %u201cyes) = 6/9 = 0.667 P(student = %u201cyes%u201d | buys_computer = %u201cno%u201d) = 1/5 = 0.2 P(credit_rating = %u201cfair%u201d | buys_computer = %u201cyes%u201d) = 6/9 = 0.667 P(credit_rating = %u201cfair%u201d | buys_computer = %u201cno%u201d) = 2/5 = 0.4 X = (age <= 30 , income = medium, student = yes, credit_rating = fair) P(X|Ci) : P(X|buys_computer = %u201cyes%u201d) = 0.222 x 0.444 x 0.667 x 0.667 = 0.044 P(X|buys_computer = %u201cno%u201d) = 0.6 x 0.4 x 0.2 x 0.4 = 0.019 P(X|Ci)*P(Ci) : P(X|buys_computer = %u201cyes%u201d) * P(buys_computer = %u201cyes%u201d) = 0.028 P(X|buys_computer = %u201cno%u201d) * P(buys_computer = %u201cno%u201d) = 0.007 Therefore, X belongs to class (%u201cbuys_computer = yes%u201d) Avoiding the Zero-Probability Problem: