Binary classification Created 2026-10-05 Updated 2026-10-14
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.
Conditional class probability 2026-09-24
The conditional class probability for class isA 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.
Minimum-integral decision region 2026-10-14
For integrable real , including points where decreases the integral and including points where increases it. Thus the negative set minimizes the integral, up to null sets and arbitrary choices where . This elementary signed-integral fact derives the Bayes classifier and cost-sensitive Bayes classifier.
Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 43 5 i Solution Created 2026-10-03 Updated 2026-10-14
Under equal costs for either wrong assignment, the Bayes classifier chooses the class of greatest posterior probability. With positive prior probabilities, it assigns class one when ; ties can be resolved arbitrarily. For the two multivariate normal densities with common positive-definite covariance matrix , their normalizing factors cancel. The log posterior odds areTherefore the Gaussian Bayes classifier has the required linear form, withA larger prior probability for class one decreases , expanding its decision region. The prior-dependent Gaussian discriminant boundary is the hyperplane .
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 46 2 a Solution Created 2026-10-03 Updated 2026-10-14
The inequality in the printed rule is reversed. With the stated definition of , a larger score favors group one. For example, in one dimension take , , , equal priors and . The score is , and , whereas the printed rule assigns group two. The correct Bayes classifier follows from minimizing the error cost as follows.
Let be the region assigned to group one, let be its multivariate normal density, and let each misclassification cost , with zero cost for correct classification. The expected cost isThe permitted integral-minimization result therefore selects . Points of equality may be assigned to either group without changing the risk. Equivalently, the Bayes classifier chooses the larger posterior probability.
For positive priors and a common positive-definite covariance matrix, the normalization constants cancel in the likelihood ratio. Expanding the two quadratic forms givesThus the correct Gaussian Bayes classifier, choosing group one on ties, isThis proves the intended classification result with the necessary correction. Equal error costs remove from the decision, while prior odds determine the threshold.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 46 2 b ii Solution Created 2026-10-03 Updated 2026-10-14
Evaluating the fitted linear discriminant analysis score givesThe fifth individual lies exactly on the discriminant boundary. Its two fitted posterior probabilities are equal, so the equal-prior Bayes classifier cannot prefer either species. A specified tie convention could assign it to one species, but such an assignment would not be evidence favoring that species.
In the sketch the solid line is the equal-prior boundary. The dashed line is the prior-dependent Gaussian discriminant boundary for the altered priors in (iii).
Beetle classifications and the parallel boundary shift when fattus has twice the prior probability
. Details. Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 47 2 b ii Solution Created 2026-10-03 Updated 2026-10-14
Apply the minimum-integral decision region principle to . The optimal Bayes classifier chooses class one when , and class two for the reverse inequality. Ties can be assigned either way. An everywhere valid discriminant score isWhere both weighted densities are positive one may equivalently use and threshold zero. This chooses the largest posterior class probability, because both posterior probabilities have the same positive mixture-density denominator.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 210 2 Solution Created 2026-10-03 Updated 2026-10-05
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 thereforeEither 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 giveLikewise the probability with label zero is . These sets determine the joint probability distribution, soThe 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 isThe 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 areThe 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, soThe 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 classificationThus 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.
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 218 5 a Solution 2026-09-28
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 218 6 a Solution Created 2026-09-28 Updated 2026-10-03
The binary regression functions are the conditional class probabilitiesUnder zero-one loss, the Bayes classifier iswith arbitrary tie breaking. Its Bayes decision boundary is
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 28K a Solution Created 2026-09-24 Updated 2026-09-25
Let be the multivariate normal density of . Under zero-one loss, the Bayes classifier chooses the class with the larger posterior probability. ThusEquivalently, it chooses class one when the log posterior oddsis nonnegative. The decision boundary is .
If , the terms cancel, leavingan affine function. This is the linear boundary of linear discriminant analysis. If , the quadratic part iswhich is nonzero, so the boundary is a possibly degenerate quadratic hypersurface, as in quadratic discriminant analysis. This is the Gaussian Bayes classifier.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 28K b Solution Created 2026-09-24 Updated 2026-09-25
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 whenand 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 setBecause 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.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 28K c Solution Created 2026-09-24 Updated 2026-10-03
For , let be the Bayes classifier with class-zero prior , and define its two class-conditional error probabilities byWriting the likelihood ratio as , the rule chooses class one whenThe 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, givingAs , 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 , namelyThus no prior has larger Bayes risk.
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 218 3 a Solution Created 2026-09-24 Updated 2026-09-25
The conditional class probability is . A Bayes classifier choosesand its Bayes risk isA sequence of classifiers is consistent when as , with convergence interpreted in probability or in expectation according to whether the training sample is conditioned upon.
