www.pudn.com > bayes.rar > drug.nbc
/*----------------------------------------------------------------------
domains
----------------------------------------------------------------------*/
dom(Age) = ZZ;
dom(Blood_pressure) = { high, low, normal };
dom(Drug) = { A, B };
/*----------------------------------------------------------------------
naive Bayes classifier
----------------------------------------------------------------------*/
nbc(Drug) = {
prob(Drug) = {
A: 6,
B: 6 };
prob(Age|Drug) = {
A: N(36.3333, 161.867) [6],
B: N(47.8333, 310.967) [6] };
prob(Blood_pressure|Drug) = {
A:{ high: 3, low: 0, normal: 3 },
B:{ high: 0, low: 3, normal: 3 }};
};
/*----------------------------------------------------------------------
number of attributes: 3
number of tuples : 12
----------------------------------------------------------------------*/