Binary classification 2026-10-05
Classification in statistical learning with two possible labels. Given the conditional probability , a Bayes classifier under zero-one loss predicts one exactly when , with arbitrary decisions at ties.
The conditional class probability for class is
A Bayes classifier selects a class maximizing this probability.
Minimax Gaussian Bayes classifier from equal class errors Created 2026-09-24 Updated 2026-09-24
For two distinct nonsingular Gaussian class distributions, vary the class-zero prior continuously. The class-zero and class-one error probabilities of the corresponding Bayes classifier cross. At a crossing they are equal, making the classifier an equalizer rule, a minimax decision rule, and the associated prior a least favorable prior.
Choose a Borel measurable function version of the posterior success probability . Conditional on , predicting zero has error probability and predicting one has error probability . A Bayes classifier for zero-one loss is therefore
Either decision is optimal when . The displayed Bayes risk also equals and is unaffected by changing on a -null set.
For any measurable set , independence and the uniform distribution of give
Likewise the probability with label zero is . These sets determine the joint probability distribution, so
The same construction makes all training pairs independent and identically distributed random variables.
Fix a feature-measurable nearest-neighbour tie-breaking rule, for example increasing original index for observations at equal Euclidean norm distance from the query. This is important: the ordering may depend on the features, but not on the or labels. Let be the label attached to the th ordered feature. The classifier from the K-nearest neighbors algorithm is
The displayed rule resolves a tied vote in favour of one; any fixed vote convention would also define the method. When , this is the one-nearest-neighbour classifier .
Write for the selected original index. Conditional on all features , it is fixed, and is still uniform on . The two decisions being compared are
The latter is an oracle comparison rule: its relabeling is recomputed at each query , rather than being a fixed relabeling of the training data for all queries. For a variable with the uniform distribution on , the two threshold indicators at differ exactly when lies between them, an interval of length . This Bernoulli coupling by a shared uniform random variable proves
Take the test pair independent of the training data and its auxiliary uniforms. Let , and interpret as conditional misclassification risk given . The tower property of conditional expectation gives . Conditional on the test feature and all training features, and are independent variables with a Bernoulli distribution of parameter . Consequently, for every ,
This is an exact finite-sample equality, not merely a limit.
The two error indicators can differ only if the two classifiers disagree, so
The permitted nearest-neighbour approximation theorem states that the last expected value tends to zero for the feature-based selection rule. This establishes the one-nearest-neighbour asymptotic risk
For , put . Then , and . Integrating gives the Bayes risk bound for one-nearest-neighbour classification
Thus a one-nearest-neighbour classifier need not achieve the Bayes risk: for constant , its limiting misclassification risk is , while .
Feature-based neighbour tie-breaking is required. The convention cannot be dropped for arbitrary . For a counterexample, take almost surely and constant , and choose among the coincident neighbours the one with the smallest . Then the predicted label is one with probability , so its misclassification risk tends to , exceeding the claimed upper bound . The corrected theorem uses ties determined independently of the uniforms and labels, as above.
For , the risk is
The Bayes classifier is , with risk .
The binary regression functions are the conditional class probabilities
Under zero-one loss, the Bayes classifier is
with arbitrary tie breaking. Its Bayes decision boundary is
Let be the multivariate normal density of . Under zero-one loss, the Bayes classifier chooses the class with the larger posterior probability. Thus
Equivalently, it chooses class one when the log posterior odds
is nonnegative. The decision boundary is .
If , the terms cancel, leaving
an affine function. This is the linear boundary of linear discriminant analysis. If , the quadratic part is
which is nonzero, so the boundary is a possibly degenerate quadratic hypersurface, as in quadratic discriminant analysis. This is the Gaussian Bayes classifier.
Condition on the observed value . If a classifier reports class zero, its conditional probability of error is ; if it reports class one, the conditional error is . Therefore the smaller conditional error is attained by class one exactly when
and by class zero exactly when the reverse strict inequality holds. Integrating these pointwise conditional errors proves that is a Bayes classifier.
The only possible nonuniqueness lies on the tie set
Because the two Gaussian class distributions are distinct, is not identically zero. It is a nonzero polynomial of degree at most two, so its zero set has Lebesgue measure zero. Both Gaussian laws have densities with respect to Lebesgue measure, hence assign probability zero to . Every Bayes rule must therefore agree with almost surely. This proves the uniqueness of a Bayes classifier up to the standard null-set equivalence of decision rules.
For , let be the Bayes classifier with class-zero prior , and define its two class-conditional error probabilities by
Writing the likelihood ratio as , the rule chooses class one when
The Gaussian likelihood-ratio level sets have probability zero, so dominated convergence shows that and depend continuously on . As , the threshold tends to zero and the classifier chooses class one almost surely, giving
As , it chooses class zero almost surely, giving the opposite limit . The intermediate value theorem therefore provides such that
The rule is an equalizer rule with worst-case risk . For any classifier ,
because minimizes the integrated risk for its prior. Hence is a minimax decision rule, as summarized by the minimax Gaussian Bayes classifier from equal class errors.
The prior is indeed least favorable. Its Bayes risk is , while for any other prior the Bayes risk is at most the integrated risk of the same equalizer rule , namely
Thus no prior has larger Bayes risk.
The conditional class probability is . A Bayes classifier chooses
and its Bayes risk is
A sequence of classifiers is consistent when as , with convergence interpreted in probability or in expectation according to whether the training sample is conditioned upon.