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.
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.
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.