The Bayes theorem
In order to understand the Bayes theorem first, before we attempt to take a look at the Naïve Bayes classification method, we should consider this example. Let's assume that among all the people in the U universe, the set of people who have breast cancer is set A, and set B is the set of people who had a screening test and were unfortunately diagnosed with the result positive for breast cancer. This is shown as the overlap region A∩B in the following diagram:

There are two unusual areas that need focus: B – A∩B or people without breast cancer and with a positive test on diagnosis and the event A – A∩B or people with breast cancer and with a negative test on diagnosis. Now, let's attempt to answer whether we know that the test is positive for a randomly selected person. Then, what is the probability that the person has breast cancer? This visually translates to whether we know that a person is visible in the B area, then what is the probability that the same person appears...