Aller au contenu principal

Bayes classifier


Bayes classifier


In statistical classification, the Bayes classifier is the classifier having the smallest probability of misclassification of all classifiers using the same set of features.

Definition

Suppose a pair ( X , Y ) {\displaystyle (X,Y)} takes values in R d × { 1 , 2 , , K } {\displaystyle \mathbb {R} ^{d}\times \{1,2,\dots ,K\}} , where Y {\displaystyle Y} is the class label of an element whose features are given by X {\displaystyle X} . Assume that the conditional distribution of X, given that the label Y takes the value r is given by

where " {\displaystyle \sim } " means "is distributed as", and where P r {\displaystyle P_{r}} denotes a probability distribution.

A classifier is a rule that assigns to an observation X=x a guess or estimate of what the unobserved label Y=r actually was. In theoretical terms, a classifier is a measurable function C : R d { 1 , 2 , , K } {\displaystyle C:\mathbb {R} ^{d}\to \{1,2,\dots ,K\}} , with the interpretation that C classifies the point x to the class C(x). The probability of misclassification, or risk, of a classifier C is defined as

The Bayes classifier is

In practice, as in most of statistics, the difficulties and subtleties are associated with modeling the probability distributions effectively—in this case, P ( Y = r X = x ) {\displaystyle \operatorname {P} (Y=r\mid X=x)} . The Bayes classifier is a useful benchmark in statistical classification.

The excess risk of a general classifier C {\displaystyle C} (possibly depending on some training data) is defined as R ( C ) R ( C Bayes ) . {\displaystyle {\mathcal {R}}(C)-{\mathcal {R}}(C^{\text{Bayes}}).} Thus this non-negative quantity is important for assessing the performance of different classification techniques. A classifier is said to be consistent if the excess risk converges to zero as the size of the training data set tends to infinity.

Considering the components x i {\displaystyle x_{i}} of x {\displaystyle x} to be mutually independent, we get the naive Bayes classifier, where

Properties

Proof that the Bayes classifier is optimal and Bayes error rate is minimal proceeds as follows.

Define the variables: Risk R ( h ) {\displaystyle R(h)} , Bayes risk R {\displaystyle R^{*}} , all possible classes to which the points can be classified Y = { 0 , 1 } {\displaystyle Y=\{0,1\}} . Let the posterior probability of a point belonging to class 1 be η ( x ) = P r ( Y = 1 | X = x ) {\displaystyle \eta (x)=Pr(Y=1|X=x)} . Define the classifier h {\displaystyle {\mathcal {h}}^{*}} as

Then we have the following results:

Proof of (a): For any classifier h {\displaystyle h} , we have

where the second line was derived through Fubini's theorem

Notice that R ( h ) {\displaystyle R(h)} is minimised by taking x X {\displaystyle \forall x\in X} ,

Therefore the minimum possible risk is the Bayes risk, R = R ( h ) {\displaystyle R^{*}=R(h^{*})} .

Proof of (b):


Proof of (c):

Proof of (d):

General case

The general case that the Bayes classifier minimises classification error when each element can belong to either of n categories proceeds by towering expectations as follows.

This is minimised by simultaneously minimizing all the terms of the expectation using the classifier h ( x ) = k , arg max k P r ( Y = k | X = x ) {\displaystyle h(x)=k,\quad \arg \max _{k}Pr(Y=k|X=x)} for each observation x.

See also

  • Naive Bayes classifier

References


Text submitted to CC-BY-SA license. Source: Bayes classifier by Wikipedia (Historical)



ghbass