Database Reference
In-Depth Information
technique assigns a small nonzero probability to rare events not included in the
training dataset. Also, the smoothing addresses the possibility of taking the
logarithm of zero that may occur in Equation 7.15 .
There are various smoothing techniques. Among them is the Laplace
smoothing (or add-one) technique that pretends to see every outcome once more
than it actually appears. This technique is shown in Equation 7.16 .
7.16
For example, say that 100 clients subscribe to the term deposit, with 20 of them
single,
70
married,
and
10
divorced. The “raw” probability is
. With Laplace smoothing adding
one
to
the
counts,
the
adjusted
probability
becomes
.
One problem of the Laplace smoothing is that it may assign too much probability
to unseen events. To address this problem, Laplace smoothing can be generalized
to use instead of 1, where typically
. See Equation 7.17 .
7.17
Smoothing techniques are available in most standard software packages for naïve
Bayes classifiers. However, if for some reason (like performance concerns) the
naïve Bayes classifier needs to be coded directly into an application, the smoothing
and logarithm calculations should be incorporated into the implementation.
7.2.4 Diagnostics
Unlike logistic regression, naïve Bayes classifiers can handle missing values. Naïve
Bayes is also robust to irrelevant variables—variables that are distributed among
all the classes whose effects are not pronounced.
The model is simple to implement even without using libraries. The prediction is
based on counting the occurrences of events, making the classifier efficient to run.
Naïve Bayes is computationally efficient and is able to handle high-dimensional
Search WWH ::




Custom Search