&&Conditional probability If A and B are two events, the probability ofevent A when we already know that event Bhas occurred is defined by the relationP(AnB)P(A|B) =P(B) This conditional probability P[A]B] is read:the “conditional probability of A conditioned on B",or simplythe "probability of A given B
Conditional probability ◼ If A and B are two events, the probability of event A when we already know that event B has occurred is defined by the relation ◼ This conditional probability P[A|B] is read: ◆ the “conditional probability of A conditioned on B”, or simply ◆ the “probability of A given B
Bayes Theorem P(A) and P(B) are the probabilities of A and B withoutregard to each other. (prior) P(A|B), a conditional probability, is the probability ofobserving event A given that B is true. (posteriori)P(A)P(B|A)P(A|B) :P(B)Thomas Bayesgambling and with thenew conceptof insurance.Oneparticularly importantproblem concerned so-calledin-1701-1761verseprobability.Asolution wasproposedbyThomasThomas Baves was born in Tun-Bayes inhispaper'Essay towards solving a problembridge Wells and was a clergymanin the doctrine of chances,which was published in1764,some three years after his death,in the Philo-aswell asan amateur scientistanda mathematician. He studied logicsophical Transactions of the Royal Society.In factand theology at Edinburgh Univer-Bayesonlyformulated histheoryforthecaseofauni-sity and was elected Fellow of theformprior,anditwasPierre-SimonLaplacewhoindeRoyal Society in 1742.During the 18th centuryis-pendentlyrediscoveredthetheoryingeneralformandsues regarding probability arose in connection withwho demonstrated itsbroadapplicability
Bayes Theorem ◼ P(A) and P(B) are the probabilities of A and B without regard to each other. (prior) ◼ P(A|B), a conditional probability, is the probability of observing event A given that B is true. (posteriori)
Exampleof BayesTheorem Given:A doctor knows that meningitis causes stiff neck 5o% of the timePrior probability of any patient having meningitis is 1/50,000Prior probability of any patient having stiff neck is 1/20 If a patient has stiff neck, what's the probabilityhe/she has meningitis?0.5×1/50000P(SI M)P(M):0.0002P(M IS)三P(S)1/20
Example of Bayes Theorem ◼ Given: ◆ A doctor knows that meningitis causes stiff neck 50% of the time ◆ Prior probability of any patient having meningitis is 1/50,000 ◆ Prior probability of any patient having stiff neck is 1/20 ◼ If a patient has stiff neck, what’s the probability he/she has meningitis? 0.0002 1/ 20 0.5 1/50000 ( ) ( | ) ( ) ( | ) = = = P S P S M P M P M S
PracticeThe entire output of a factory is produced on threemachines. The three machines account for 20%30%, and 50% of the output, respectively. Thefraction of defective items produced is this: for thefirst machine, 5%: for the second machine, 3%: forthe third machine, 1%. If an item is chosen atrandom from the total output and is found to bedefective, what is the probability that it wasproduced by the third machine?THEORYPRACTICEY
Practice The entire output of a factory is produced on three machines. The three machines account for 20%, 30%, and 50% of the output, respectively. The fraction of defective items produced is this: for the first machine, 5%; for the second machine, 3%; for the third machine, 1%. If an item is chosen at random from the total output and is found to be defective, what is the probability that it was produced by the third machine?
Naive Bayes Classifiers Consider each attribute and class label asrandom yariables Given a record with attributesS (A1, A2,...,An)Goal is to predict class CSpecifically, we want to find the value of C thatmaximizes P(CI A1, A2,...,An) Can we estimate P(Cl A1, A2,...,An) directlyfrom data?
Naïve Bayes Classifiers ◼ Consider each attribute and class label as random variables ◼ Given a record with attributes (A1 , A2 ,.,An ) ◆ Goal is to predict class C ◆ Specifically, we want to find the value of C that maximizes P(C| A1 , A2 ,.,An ) ◼ Can we estimate P(C| A1 , A2 ,.,An ) directly from data?