Naive Bayesian classification
Naive Bayesian classification is the popular name for a probabilistic classification method. A more descriptive term for the underlying probability model is independent feature model. The term Naive Bayes refers to the fact that the probability model can be derived using Bayes' Theorem (credited to Thomas Bayes) and that it incorporates strong independences assumption that often have no bearing in reality, hence are (deliberately) naive. Depending on the precise nature of the probability model, Naive Bayes classifiers can be trained very efficiently in a supervised learning setting. In many practical applications, parameter estimation for Naive Bayes models uses the method of maximum likelihood; in other words, one can work with the Naive Bayes model without believing in Bayesian probability or using any Bayesian methods.Abstractly, the desired probability model for a classifier is a conditional model
Using Bayes' Theorem, we write
Models of this form tend to be much more manageable, since they factor into a so-called class prior and independent probability distributions . If there are classes and if a model for can be expressed in terms of parameters, then the corresponding Naive Bayes model has parameters. In practice, often (binary classification) and (Bernoulli variables as features) are common, and so the total number of parameters of the Naive Bayes model is , where is the number of binary features used for prediction.
The discussion so far has derived the independent feature model a.k.a. the Naive Bayes probability model. The Naive Bayes classifier combines this model with a decision rule. One common rule is to pick the hypothesis that is most probable; this is known as the maximum a posteriori or MAP decision rule. The corresponding classifier is the function defined as follows:
The Naive Bayes classifier has several properties that make it surprisingly useful in practice, despite the fact that the far-reaching independence assumptions are often violated. Like all probabilistic classifiers under the MAP decision rule, it arrives at the correct classification as long as the correct class is more probable than any other class; class probabilities do not have to be estimated very well. In other words, the overall classifier is robust to serious deficiencies of its underlying naive probability model. Other reasons for the observed success of the Naive Bayes classifier are discussed in the literature cited below.
Here is a worked example of naive Bayesian classification to the document classification problem. Consider the problem of classifying documents by their content, for example into spam and non-spam E-mails. Imagine that documents are drawn from a number of classes of documents which can be modelled as sets of words where the (independent) probability that the i-th word of a given document occurs in a document from class C can be written as
Then the probability of a given document D, given a class C, is
Now, by their definition, (see Probability axiom)
Taking the logarithm of all these ratios, we have:
In real life, the naive Bayes approach is more powerful than might be expected from the extreme simplicity of its model; in particular, it is fairly robust in the presence of non-independent attributes wi. Recent theoretical analysis has shown why the naive Bayes classifier is so robust.
See also:
- Bayesian inference (esp. as Bayesian techniques relate to spam)
- boosting
- fuzzy logic
- logistic regression
- neural networks
- Perceptron
- Support vector machine
External links
- Naive Bayesian learning paper
- http://www.cs.washington.edu/ai/naive.html
- An empirical study of the naive Bayes classifier (in pdf format)
- On the Optimality of the Simple Bayesian Classifier under Zero-One Loss