FACTOID # 60: Japan's water has a very high dissolved oxygen concentration - but not enough to prevent drowning in the bath.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Naive Bayes classifier

A naive Bayes classifier is a simple probabilistic classifier based on applying Bayes' theorem with strong (naive) independence assumptions. A more descriptive term for the underlying probability model would be "independent feature model". In mathematics, a classifier is a mapping from a (discrete or continuous) feature space X to a discrete set of labels Y. Classifiers have practical applications in many branches of science and society. ... Bayess theorem (also known as Bayess rule or Bayess law) is a result in probability theory, which relates the conditional and marginal probability distributions of random variables. ...


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. Supervised learning is a machine learning technique for creating a function from training data. ... Maximum likelihood estimation (MLE) is a popular statistical method used to make inferences about parameters of the underlying probability distribution from a given data set. ... Bayesian probability is an interpretation of probability suggested by Bayesian theory, which holds that the concept of probability can be defined as the degree to which a person believes a proposition. ...


In spite of their naive design and apparently over-simplified assumptions, naive Bayes classifiers often work much better in many complex real-world situations than one might expect. Recently, careful analysis of the Bayesian classification problem has shown that there are some theoretical reasons for the apparently unreasonable efficacy of naive Bayes classifiers(Zhang04). An advantage of the Naive Bayes classifier is that it requires a small amount of training data to estimate the parameters (means and variances of the variables) necessary for classification. Because independent variables are assumed, only the variances of the variables for each class need to be determined and not the entire covariance matrix. Efficacy is the ability to produce a desired amount of a desired effect. ...

Contents

The naive Bayes probabilistic model

Abstractly, the probability model for a classifier is a conditional model

p(C vert F_1,dots,F_n),

over a dependent class variable C with a small number of outcomes or classes, conditional on several feature variables F1 through Fn. The problem is that if the number of features n is large or when a feature can take on a large number of values, then basing such a model on probability tables is infeasible. We therefore reformulate the model to make it more tractable.


Using Bayes' theorem, we write Bayess theorem (also known as Bayess rule or Bayess law) is a result in probability theory, which relates the conditional and marginal probability distributions of random variables. ...

p(C vert F_1,dots,F_n) = frac{p(C)  p(F_1,dots,F_nvert C)}{p(F_1,dots,F_n)}. ,

In plain English the above equation can be written as

Posterior = frac{Prior times Likelihood}{Evidence}. ,

In practice we are only interested in the numerator of that fraction, since the denominator does not depend on C and the values of the features Fi are given, so that the denominator is effectively constant. The numerator is equivalent to the joint probability model This article defines some terms which characterize probability distributions of two or more variables. ...

p(C, F_1, dots, F_n),

which can be rewritten as follows, using repeated applications of the definition of conditional probability: This article defines some terms which characterize probability distributions of two or more variables. ...

p(C, F_1, dots, F_n),
= p(C)  p(F_1,dots,F_nvert C)
= p(C)  p(F_1vert C)  p(F_2,dots,F_nvert C, F_1)
= p(C)  p(F_1vert C)  p(F_2vert C, F_1)  p(F_3,dots,F_nvert C, F_1, F_2)
= p(C)  p(F_1vert C)  p(F_2vert C, F_1)  p(F_3vert C, F_1, F_2)  p(F_4,dots,F_nvert C, F_1, F_2, F_3)

and so forth. Now the "naive" conditional independence assumptions come into play: assume that each feature Fi is conditionally independent of every other feature Fj for jneq i. This means that In probability theory, two events A and B are conditionally independent given a third event C precisely if the occurrence or non-occurrence of A and B are independent events in their conditional probability distribution given C. In other words, Two random variables X and Y are conditionally independent given...

p(F_i vert C, F_j) = p(F_i vert C),

and so the joint model can be expressed as

p(C, F_1, dots, F_n) = p(C)  p(F_1vert C)  p(F_2vert C)  p(F_3vert C)  cdots,
= p(C) prod_{i=1}^n p(F_i vert C).,

This means that under the above independence assumptions, the conditional distribution over the class variable C can be expressed like this:

p(C vert F_1,dots,F_n) = frac{1}{Z} p(C) prod_{i=1}^n p(F_i vert C)

where Z is a scaling factor dependent only on F_1,dots,F_n, i.e., a constant if the values of the feature variables are known.


Models of this form are much more manageable, since they factor into a so-called class prior p(C) and independent probability distributions p(F_ivert C). If there are k classes and if a model for p(Fi) can be expressed in terms of r parameters, then the corresponding naive Bayes model has (k − 1) + n r k parameters. In practice, often k = 2 (binary classification) and r = 1 (Bernoulli variables as features) are common, and so the total number of parameters of the naive Bayes model is 2n + 1, where n is the number of binary features used for prediction. In probability theory and statistics, the Bernoulli distribution, named after Swiss scientist Jakob Bernoulli, is a discrete probability distribution, which takes value 1 with success probability and value 0 with failure probability . ...


Parameter estimation

All model parameters (i.e., class priors and feature probability distributions) can be approximated with relative frequencies from the training set. These are maximum likelihood estimates of the probabilities. Non-discrete features need to be discretized first. Discretization can be unsupervised (ad-hoc selection of bins) or supervised (binning guided by information in training data).


If a given class and feature value never occur together in the training set then the frequency-based probability estimate will be zero. This is problematic since it will wipe out all information in the other probabilities when they are multiplied. It is therefore often desirable to incorporate a small-sample correction in all probability estimates such that no probability is ever set to be exactly zero. A pseudocount is a count added to observed data in order to change the probability in a model of those data, which is known not to be zero, to being negligible rather than being zero. ...


Constructing a classifier from the probability model

The discussion so far has derived the independent feature model, that is, 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 classify defined as follows: A classifier, in linguistics, is a word or morpheme used in some languages in certain contexts to indicate the word class of a noun. ... In statistics, the method of maximum a posteriori (MAP, or posterior mode) estimation can be used to obtain a point estimate of an unobserved quantity on the basis of empirical data. ...

mathrm{classify}(f_1,dots,f_n) = mathop{mathrm{argmax}}_c  p(C=c) prod_{i=1}^n p(F_i=f_ivert C=c)

Discussion

One should notice that the independency assumption may lead to some unexpected results in the calculation of posteriori probability. In some circumstances when there is a dependency between observations, the above-mentioned probability may contradict with the second axiom of probability by which any probability must be less than or equal to one.


Despite the fact that the far-reaching independence assumptions are often inaccurate, the naive Bayes classifier has several properties that make it surprisingly useful in practice. In particular, the decoupling of the class conditional feature distributions means that each distribution can be independently estimated as a one dimensional distribution. This in turn helps to alleviate problems stemming from the curse of dimensionality, such as the need for data sets that scale exponentially with the number of features. 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; hence class probabilities do not have to be estimated very well. In other words, the overall classifier is robust enough to ignore serious deficiencies in its underlying naive probability model. Other reasons for the observed success of the naive Bayes classifier are discussed in the literature cited below. Curse of dimensionality is a term coined by Richard Bellman applied to the problem caused by the rapid increase in volume associated with adding extra dimensions to a (mathematical) space. ...


Example: document classification

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 Document classification/categorization is a problem in information science. ... A KMail folder full of spam emails collected over a few days. ... Wikipedia does not yet have an article with this exact name. ...

p(w_i vert C),

(For this treatment, we simplify things further by assuming that the probability of a word in a document is independent of the length of a document, or that all documents are of the same length.)


Then the probability of a given document D, given a class C, is

p(Dvert C)=prod_i p(w_i vert C),

The question that we desire to answer is: "what is the probability that a given document D belongs to a given class C?" In other words, what is p(C vert D),?


Now, by their definition, (see Probability axiom) The probability of some event (denoted ) is defined with respect to a universe or sample space of all possible elementary events in such a way that must satisfy the Kolmogorov axioms. ...

p(Dvert C)={p(Dcap C)over p(C)}

and

p(Cvert D)={p(Dcap C)over p(D)}

Bayes' theorem manipulates these into a statement of probability in terms of likelihood. In statistics, a likelihood function is a conditional probability function considered a function of its second argument with its first argument held fixed, thus: and also any other function proportional to such a function. ...

p(Cvert D)={p(C)over p(D)},p(Dvert C)

Assume for the moment that there are only two classes, S and ¬S (e.g. spam and not spam).

p(Dvert S)=prod_i p(w_i vert S),

and

p(Dvertneg S)=prod_i p(w_ivertneg S),

Using the Bayesian result above, we can write:

p(Svert D)={p(S)over p(D)},prod_i p(w_i vert S)
p(neg Svert D)={p(neg S)over p(D)},prod_i p(w_i vertneg S)

Dividing one by the other gives:

{p(Svert D)over p(neg Svert D)}={p(S),prod_i p(w_i vert S)over p(neg S),prod_i p(w_i vertneg S)}

Which can be re-factored as:

{p(Svert D)over p(neg Svert D)}={p(S)over p(neg S)},prod_i {p(w_i vert S)over p(w_i vertneg S)}

Thus, the probability ratio p(S | D) / p(¬S | D) can be expressed in terms of a series of likelihood ratios. The actual probability p(S | D) can be easily computed from log (p(S | D) / p(¬S | D)) based on the observation that p(S | D) + p(¬S | D) = 1. A likelihood-ratio test is a statistical test relying on a test statistic computed by taking the ratio of the maximum value of the likelihood function under the constraint of the null hypothesis to the maximum with that constraint relaxed. ...


Taking the logarithm of all these ratios, we have: Logarithms to various bases: is to base e, is to base 10, and is to base 1. ...

ln{p(Svert D)over p(neg Svert D)}=ln{p(S)over p(neg S)}+sum_i ln{p(w_ivert S)over p(w_ivertneg S)}

(This technique of "log-likelihood ratios" is a common technique in statistics. In the case of two mutually exclusive alternatives (such as this example), the conversion of a log-likelihood ratio to a probability takes the form of a sigmoid curve: see logit for details.) A likelihood-ratio test is a statistical test relying on a test statistic computed by taking the ratio of the maximum value of the likelihood function under the constraint of the null hypothesis to the maximum with that constraint relaxed. ... The logistic function or logistic curve is defined by the mathematical formula: for real parameters a, m, n, and . ... In mathematics, especially as applied in statistics, the logit (pronounced with a long o and a soft g, IPA ) of a number p between 0 and 1 is This function is used in logistic regression. ...


Finally, the document can be classified as follows. It is spam if ln{p(Svert D)over p(neg Svert D)} > 0, otherwise it is not spam.


See also

A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of variables and their probabilistic dependencies. ... The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ... Bayesian inference is statistical inference in which evidence or observations are used to update or to newly infer the probability that a hypothesis may be true. ... A typical spam advertisement Spam by e-mail is one type of spamming that involves sending identical or nearly identical messages to thousands (or millions) of recipients. ... Boosting is a machine learning meta-algorithm for performing supervised learning. ... Fuzzy logic is derived from fuzzy set theory dealing with reasoning that is approximate rather than precisely deduced from classical predicate logic. ... Logistic regression is a statistical regression model for Bernoulli-distributed dependent variables. ... // See also Artificial neural network. ... Predictive analytics encompasses a variety of techniques from statistics and data mining that process current and historical data in order to make “predictions” about future events. ... The perceptron is a type of artificial neural network invented in 1957 at the Cornell Aeronautical Laboratory by Frank Rosenblatt. ... Support vector machines (SVMs) are a set of related supervised learning methods used for classification and regression. ...

References

  • Domingos, Pedro & Michael Pazzani (1997) "On the optimality of the simple Bayesian classifier under zero-one loss". Machine Learning, 29:103–­137. (also online at CiteSeer: [1])
  • Rish, Irina. (2001). "An empirical study of the naive Bayes classifier". IJCAI 2001 Workshop on Empirical Methods in Artificial Intelligence. (available online: PDF, PostScript)
  • Hand, DJ, & Yu, K. (2001). "Idiot's Bayes - not so stupid after all?" International Statistical Review. Vol 69 part 3, pages 385-399. ISSN 0306-7734.
  • Mozina M, Demsar J, Kattan M, & Zupan B. (2004). "Nomograms for Visualization of Naive Bayesian Classifier". In Proc. of PKDD-2004, pages 337-348. (available online: PDF)
  • Maron, M. E. (1961). "Automatic Indexing: An Experimental Inquiry." Journal of the ACM (JACM) 8(3):404–417. (available online: PDF)
  • Minsky, M. (1961). "Steps toward Artificial Intelligence." Proceedings of the IRE 49(1):8-30.
  • McCallum, A. and Nigam K. "A Comparison of Event Models for Naive Bayes Text Classification". In AAAI/ICML-98 Workshop on Learning for Text Categorization, pp. 41-48. Technical Report WS-98-05. AAAI Press. 1998. (available online: PDF)
  • Harry Zhang "The Optimality of Naive Bayes". (available online: PDF)
  • S.Kotsiantis, P. Pintelas, Increasing the Classification Accuracy of Simple Bayesian Classifier, Lecture Notes in Artificial Intelligence, AIMSA 2004, Springer-Verlag Vol 3192, pp. 198-207, 2004 (http://www.math.upatras.gr/~esdlab/en/members/kotsiantis/improvingNB.pdf)
  • S. Kotsiantis, P. Pintelas, Logitboost of Simple Bayesian Classifier, Computational Intelligence in Data mining Special Issue of the Informatica Journal, Vol 29 (1), pp. 53-59, 2005 (http://www.math.upatras.gr/~esdlab/en/members/kotsiantis/05_Kotsiantis-Logitboost%20of%20simble%20bayesian..._No%205.pdf)

External links

Software

  Results from FactBites:
 
Naive Bayes classifier - Wikipedia, the free encyclopedia (1308 words)
A naive Bayes classifier (also known as Idiot's Bayes) is a simple probabilistic classifier based on applying Bayes' theorem with strong (naive) independence assumptions.
The naive Bayes classifier combines this model with a decision rule.
Hierarchical Naive Bayes Classifiers for uncertain data (an extension of the Naive Bayes classifier).
BioMed Central | Full text | Predicting DNA-binding sites of proteins from amino acid sequence (6078 words)
We show that the performance of the classifier is improved by using sequence entropy of the target residue (the entropy of the corresponding column in multiple alignment obtained by aligning the target sequence with its sequence homologs) as additional input.
Table 1 shows that the classifier using amino acid identities as input achieved an overall accuracy of 71% with a correlation coefficient of 0.24, 35% of the residues predicted to be interface residues are actually interface residues, and 53% of interface residues are correctly identified.
Classifiers trained using features other than the amino acid identities of target residue and its neighbors as input achieved performance that was lower than that of the classifier using amino acid identities of the corresponding residues as input (data not shown).
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.