What it’s and How you can apply it to a real-world scenario
This 12 months, my resolution is to return to the fundamentals of knowledge science. I work with data each day, however it’s easy to forget how a number of the core algorithms function in case you’re completing repetitive tasks. I’m aiming to do a deep dive into a knowledge algorithm each week here on Towards Data Science. This week, I’m going to cover Naive Bayes.
Simply to get this out of the way in which, you’ll be able to learn the way to pronounce Naive Bayes here.
Now that we all know the way to say it, let’s take a look at what it means…
This probabilistic classifier relies on Bayes’ theorem, which could be summarized as follows:
The conditional probability of an event when a second event has already occurred is the product of “event B, given A and the probability of A divided by the probability of event B.”
P(A|B) = P(B|A)P(A) / P(B)
A standard misconception is that Bayes’ Theorem and conditional probability are synonymous.
Nevertheless, there’s a distinction — Bayes’ Theorem uses the definition of conditional probability to seek out what’s often called the “reverse probability” or the “inverse probability”.
Said one other way, the conditional probability is the probability of A given B. Bayes’ Theorem takes that and finds the probability of B given A.
A notable feature of the Naive Bayes algorithm is its use of sequential events. Put simply, by acquiring additional information later, the initial probability is adjusted. We are going to call these the prior probability/marginal probability and the posterior probability. The fundamental takeaway is that by knowing one other condition’s consequence, the initial probability changes.
A very good example of that is taking a look at medical testing. For instance, if a patient is coping with gastrointestinal issues, the doctor might suspect Inflammatory Bowel Disorder (IBD). The initial probability of getting this condition is about 1.3%.