Classifying with Naïve Bayes
The Naïve Bayes classifier is one of the simplest classification techniques. It uses Bayes' Theorem of conditional probability of an event happening given that some other event occurs. The Naïve Bayes classifier leverages the very familiar formula:
P(A|B) = P(B|A) P(A) / P(B)
In other words, we want to calculate the probability of the outbound call resulting in a credit application (A) given the various characteristics of the call and caller (B). This is equivalent to the ratio of the product of the observed frequency of applying for credit: the P(A), and the frequency of such characteristics of the call and caller occurring for those who had taken the offer in the past: the P(B|A), to the frequency of such a call and caller occurring in our dataset: the P(B).
Getting ready
To execute this recipe, you will need pandas
and scikit-learn
. We will also use our helper.py
script so you will need NumPy
and time
modules.
As our helper.py
is located...