Understanding Machine Learning VI: Linear Predictors, the Perceptron and Least SquaresTextbook
Motivation
Part II of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) turns from the theory of learnability to hypothesis classes that can actually be learned by algorithms, and it starts with the family that almost every practical method is built on: linear predictors. Chapter 9 introduces the affine functions and the three classes obtained by composing them with a link: halfspaces for classification, linear regression for real-valued prediction, and logistic regression in between. For each class it gives an ERM algorithm and the guarantee that goes with it. For halfspaces in the separable case the algorithm is Rosenblatt's Perceptron, and the guarantee is the classical mistake bound (Theorem 9.1): the number of updates is at most , where bounds the data and is the norm of the smallest vector separating it with margin one. The chapter then computes the VC-dimension of halfspaces (Theorems 9.2 and 9.3), which by the fundamental theorem of Mission IV makes them learnable, derives the Least Squares normal equations for regression, and observes that the logistic loss is convex, the property later chapters exploit.
Setting
Vectors live in with its Euclidean inner product and norm. The affine functions are , homogenous when ; a halfspace hypothesis is , formalized as a Boolean predictor that is true exactly when (the book leaves unspecified; the VC computations do not depend on the convention). A sample with labels is separable if some has for all ; the constants of Theorem 9.1 are and . The Batch Perceptron starts at and, while some example has , adds ; since the algorithm may pick any mistaken example, a run is any sequence of updates obeying this rule, and the theorem is stated for all runs. For regression the loss is and the Least Squares system is with , written as the linear map , and . The logistic function is and the logistic loss is . The learning-theoretic notions (ERM, PAC and agnostic PAC learnability, VC-dimension) are those of Missions I and IV.
Formalization targets
Goal: Theorem 9.1 (Perceptron convergence)
For a separable sample with labels in , every run of the Batch Perceptron of iterations satisfies , and some run of at most iterations ends with for every .
Milestones
Equation (9.1). A sample is separable if and only if some satisfies for all .
Theorem 9.2. The VC-dimension of the homogenous halfspaces in is .
Theorem 9.3. The VC-dimension of the halfspaces in is .
Least Squares (9.6). The system always has a solution, and solves it if and only if is an ERM hypothesis for the squared loss over the homogenous linear predictors.
Further items: Exercise 9.3, the tightness of Theorem 9.1 (for every a sample with , and a run of exactly updates); the learnability of halfspaces by ERM, a consequence of Theorem 9.3 and the fundamental theorem; Exercise 9.2, is invertible iff the span ; and the convexity of the logistic loss in .
Significance
The Perceptron bound is one of the oldest results of learning theory (Novikoff 1962) and the model for every mistake bound in the online-learning chapters: it is independent of the dimension and of the number of examples, depending only on the geometry of the data through and . Theorems 9.2 and 9.3 are the first VC-dimension computations of a class used in practice and give, through Theorem 6.8, the sample complexity of learning halfspaces. The normal equations are the algorithmic content of linear regression, and the convexity of the logistic loss is why logistic regression is tractable in the nonseparable case, where ERM for halfspaces with the 0–1 loss is hard.
Nothing here is machine-checked in this form. Mathlib has the inner-product geometry, the Cauchy–Schwarz inequality, linear algebra of finite-dimensional spaces and convexity of compositions, but neither the Perceptron nor the VC-dimension of halfspaces.
Difficulty
Equation (9.1) is a rescaling and the intended entry point. The convexity of the logistic loss is the composition of the convex function with the linear map . Exercise 9.2 is the identification of the kernel of with the orthogonal complement of the span. The normal equations require showing that a convex quadratic is minimized exactly where its gradient vanishes, and that lies in the range of , which is the span of the . Theorem 9.1 is the book's proof: by induction on the run, and for any feasible , then Cauchy–Schwarz, and finally the passage from a feasible to the infimum ; the existence clause follows because a run can be extended as long as the stopping condition fails and all runs are bounded. Theorem 9.2 is the linear-dependence argument of the book, with a case analysis on the signs of the coefficients and on which side is nonempty, and the shattering of the standard basis; Theorem 9.3 lifts it to by appending a constant coordinate. The learnability of halfspaces is Theorem 6.7 applied to a class that must be shown measurable, nonempty, of finite VC-dimension and pointwise separable; the last needs rational approximations in which the offset moves below more slowly than approaches , so that boundary points keep their label.
Formalization scope
Halfspaces are Boolean predictors with negative; the classes are sets of functions, so the VC-dimension is that of Mission IV. The Perceptron is a relation on sequences, not a program: this captures the algorithm's freedom to choose any mistaken example and makes the bound apply to all implementations. is an infimum, which is attained (the feasible set is closed and the norm is coercive), but the theorem does not need attainment. is a real supremum over the finite index set, equal to for the empty sample, where every run has length . The Least Squares statement is about the homogenous class and the sample , with ERM in the sense of Mission I; the bias term is handled by the book's reduction, appending a constant coordinate, and is not formalized separately. The learnability item states qualitative learnability and the ERM guarantee with an unspecified sample-complexity function; the quantitative rate is Theorem 6.8 of Mission IV. Linear programming (§9.1.1), the pseudo-inverse (§9.2.1), polynomial regression (§9.2.2), Exercises 9.1 and 9.4–9.6 are not stated.
Trivializing readings are excluded: labels are constrained to , runs must start at and update only on mistakes, the VC equalities are in , and the ERM equivalence is a biconditional. Welcome contributions: the two Perceptron invariants as separate lemmas, the shattering of the standard basis, and the pointwise separability of halfspaces.
Selected references
- S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 9. doi:10.1017/CBO9781107298019
- F. Rosenblatt, The perceptron: a probabilistic model for information storage and organization in the brain, Psychological Review 65(6), 1958. doi:10.1037/h0042519
- A. B. J. Novikoff, On convergence proofs on perceptrons, Proceedings of the Symposium on the Mathematical Theory of Automata 12, 1962.
- S. Agmon, The relaxation method for linear inequalities, Canadian Journal of Mathematics 6, 1954. doi:10.4153/CJM-1954-037-2
- S. Ben-David, H. U. Simon, Efficient learning of linear perceptrons, Advances in Neural Information Processing Systems 13, 2001.