Page 43 - Data Science Algorithms in a Week
P. 43
Naive Bayes
So, even if the result of the test is positive and the test has accuracy is 99.9%, the probability
of the patient having the tested type of cancer is only approximately 1%. This probability of
having the cancer after taking the test is relatively low when compared to the high accuracy
of the test, but is much higher than the probability of 1 in 100,000 (0.001%), as known prior
to taking the test based on its occurrence in the population.
Proof of Bayes' theorem and its extension
Bayes' theorem states the following:
P(A|B)=[P(B|A) * P(A)]/P(B)
Proof:
We can prove this theorem using elementary set theory on the probability spaces of the
events A and B. That is, here, a probability event will be defined as the set of the possible
outcomes in the probability space:
Figure 2.1: Probability space for the two events
From figure 2.1 above, we can state the following relationships:
P(A|B)=P(A∩B)/P(B)
P(B|A)=P(A∩B)/P(A)
[ 31 ]