Original supplement on binary linear classification.
1. The output is a label, not a fitted response
Regression and classification can use the same feature vectors while solving different mathematical problems. A regression score is judged by how closely its numerical value matches a response. A binary classifier uses a score to choose between two labels. A good fit to the numbers minus one and plus one need not put the decision boundary in a good place.
The necessary foundations are real vectors and inner products, Cauchy–Schwarz, affine functions, finite sums, and bounded-sequence compactness in finite-dimensional Euclidean space. The existing least-squares note supplies the design-matrix and normal-equation results used in Question 1. Fisher discriminants already select scores from labelled scatter; they solve a different objective from the separating inequalities below. Learned metrics use a squared-distance margin, which must also be distinguished from distance to a hyperplane.
Fix a finite nonempty training list
Repeated inputs are allowed; they may have inconsistent labels. All statements in this note concern this fixed finite list. No sampling distribution or claim about future prediction error is assumed.
Score and prediction convention. A parameter pair gives the affine score and classifier
Thus a zero score predicts the positive class. The score is linear in its parameters, but is affine in x when the intercept b is nonzero. The empirical classification error is
This is not the least-squares objective . The latter penalizes the sizes of numerical discrepancies; the former counts incorrect labels after thresholding. Question 1 gives exact data where their preferred conclusions differ.
The signed score is convenient: a positive value means the example is correctly classified away from the boundary. At zero it no longer decides correctness by itself. A positive-labelled zero is correct under our rule, and a negative-labelled zero is incorrect. Consequently the condition for every i is not equivalent to zero classification error under this tie convention.
We call the list strictly affinely separable if some satisfies for every i. Strict separation is stronger than merely accepting positive ties. It is the hypothesis used in the margin and termination theorems.
2. Distance, functional margin and geometric margin
Suppose first that . The equation defines a genuine hyperplane H. It is nonempty, since lies on it. The vector w specifies an orientation as well as a normal direction: the positive scores lie on the side to which w points.
Distance proposition. For every , its unique closest point on H and its distance to H are
Indeed, substitution gives . For any , , so Cauchy–Schwarz implies . The displayed p attains this bound. To verify uniqueness explicitly, decompose . The first vector is parallel to w and the second is perpendicular to w, hence . Equality with the smallest distance forces .
In particular, the distance from the origin is , not generally b. The closest point to the origin is , whose coordinate along the oriented unit normal is .
Worked distance calculation. Let , , and . Then , and
If this point has label plus one and the origin has label minus one, their signed distances are and two. The minimum is therefore .
For a fixed list define its functional margin . For , define its signed geometric margin
If , the geometric margin is the smallest distance of a training point to the hyperplane, with all points on their prescribed sides. If , it is a signed quantity and is not a positive robustness radius.
For , replacing by preserves every prediction and the hyperplane. It multiplies a by and preserves . Thus a strictly positive functional margin can be made arbitrarily large by parameter scaling without moving the decision boundary. Both w and b must be scaled. For example, and give the same boundary, whereas changing only w produces . Negative scaling reverses signs away from the boundary; our positive tie convention still applies on the boundary.
Finite-data robustness. If and , then the perturbed training point remains strictly correctly classified. In fact,
The radius is strict. A point attaining the finite minimum can be moved to the hyperplane by . At that displacement strict separation is lost; the tie rule determines its predicted label. A slightly larger displacement in the same direction crosses the boundary. This proves a deterministic perturbation statement on the observed list, not a probability bound or a generalization theorem.
When , the score is constant. Its zero set is either all of or empty, not a nondegenerate hyperplane; division by is undefined. A list containing both labels cannot be strictly separated by a constant score. A list with one label can be, which is why the two cases must remain separate.
3. The augmented perceptron: specify the update before proving it
Encode the intercept in a final coordinate:
The finite number R is at least one. Using the largest norm of the unaugmented x alone would omit the intercept coordinate.
Assume that there is a unit vector and a number such that
Every finite strictly separable list admits such a pair: take any strict parameter , which is nonzero, put and take . The minimum is positive because there are finitely many strictly positive values. Conversely this assumption itself supplies a strict separator. Cauchy–Schwarz also gives . There is no need to know an optimal margin or solve a margin optimization problem first.
Here is one exact algorithm.
- Set and the update count .
- Make a complete pass through indices , starting with an update flag set to false.
- At a visited index i, if , replace by , increase t by one and set the flag to true. Otherwise leave it unchanged.
- Stop if the entire pass had no update. Otherwise begin another full pass.
Ties are included deliberately. Starting at zero with a strict-negative update test would make no first update at all. Our condition also updates a positive-labelled zero, even though the chosen prediction rule calls that tie positive. We therefore count mistake-or-tie updates. Ordinary prediction mistakes are a subset of them; the two counts need not be equal.
No normalization is performed between updates. The unit step size and zero initialization are part of the algorithm being proved.
The update bound
Let mean the parameter after exactly t updates, regardless of how many data visits occurred. If the next updated index is i, then
Induction from gives for every realized update count T. At the same update,
because the update condition makes the middle term nonpositive and . A second induction gives .
For , the bound below is immediate. For , Cauchy–Schwarz with the unit vector v yields
This is a bound on the total number of updates, and hence also on the number of actual prediction mistakes encountered by this algorithm. The proof includes the initial zero vector and never divides by its norm. It does not require v to be a maximum-margin vector.
Why the stated scan really stops
The bound applies to every finite realized prefix of updates. An infinite update sequence would have a prefix with integer length greater than , a contradiction. Our full-pass algorithm cannot run forever without stopping: every nonfinal pass contains an update, so infinitely many nonfinal passes would give infinitely many updates.
If its total update count is T, it has at most T nonfinal passes and one final pass. It therefore uses at most data visits. During the final pass the parameter never changes; every visited index satisfies . Because all m indices were checked, the final parameter strictly separates the entire training list.
The initial nonempty list forces at least one update, since all signed scores initially vanish. Thus the final parameter is nonzero, also seen from . One may rescale the final parameter by its positive norm without changing predictions. Doing so after every update would change the recurrence and would require a different proof.
A different algorithm may search the entire finite list for any violating index at each stage and stop only when none exists; the same update bound works. An unfair scan that keeps ignoring a violating point has no such certificate. A fixed iteration cap is likewise not a certificate unless all final inequalities are checked. The bound does not turn an arbitrary scan or stopping rule into this algorithm.
A useful constant-predictor case
For one example with label plus one, , , and has . The first update gives , followed by a no-update pass. The bound is attained. The result is the constant score one: its augmented parameter is nonzero, but its feature normal w is zero. It is a valid perceptron result, while the feature-space hyperplane-distance formula is inapplicable. Augmentation does not erase this distinction.
4. Standard hard margin: existence must include the intercept
For this section assume in addition that both labels occur and that the finite list is strictly affinely separable. The standard hard-margin problem is
The intercept b is unpenalized. This is not minimization of in the augmented space.
The feasible set is nonempty. Indeed, if strictly separates and , then is feasible. Conversely feasibility implies strict separation. With both labels, a feasible pair cannot have w zero: a positive label would require and a negative one .
Attainment by a bounded feasible sublevel
Choose one feasible pair , and put . Fix a positive-labelled index p and a negative-labelled index q. For every feasible pair with , its two corresponding constraints imply
Thus b is bounded on the relevant sublevel, even though the objective does not penalize it. Define K to be the feasible pairs with and b in this fixed closed interval. The benchmark belongs to K. Every constraint is a continuous affine inequality, so K is closed; the displayed bounds make it bounded in the finite-dimensional space .
For completeness, take a sequence in K whose objective values tend to its infimum. Finite-dimensional bounded-sequence compactness gives a convergent subsequence; closedness puts its limit in K. Continuity of gives a minimum there. Any feasible pair outside K must have , since feasible pairs inside that norm ball already obey the b bounds. Its objective is then greater than the benchmark's. The minimum on K is therefore a global minimum over all feasible pairs.
This argument earns attainment. Merely saying that the constraints are closed would not suffice on an unbounded set, and the w penalty alone does not automatically bound b without the two labels.
The normal is unique
The feasible set is convex: any convex combination of two feasible pairs satisfies every affine constraint. Suppose and are minimizing pairs. Their feasible midpoint has objective
If , this is strictly below the common minimum, impossible. Hence the minimizing w is unique. This argument does not penalize or establish strict convexity in b; no general assertion about b is inferred from it. In Question 4 the particular constraints themselves will determine b uniquely.
Why this minimizes the right norm for geometric margin
At any optimizer , let . Feasibility gives . If , divide both parameters by . This preserves feasibility and strictly reduces the objective because , a contradiction. Thus and
For any strict separator , both labels imply . With , the feasible pair has normal norm . Optimality of implies , or . The optimizer itself attains equality, so a maximum geometric margin really exists and is attained.
Conversely, if a strict separator attains this largest geometric margin, rescaling it to functional minimum one gives objective , equal to the optimal value. Hence the hard-margin formulation and feature-space geometric-margin maximization agree under the stated hypotheses. The transformation rescales parameters, not the observed feature coordinates.
5. The augmented geometry is a different geometry
The perceptron estimates progress against a unit vector in , using the norm . Its separator assumption is an augmented-space assumption. Standard hard margin instead minimizes the feature-normal norm and leaves b unpenalized.
Even when the same constraints are imposed, minimizing specifies a different objective. Its distance is measured in the augmented space, where the final data coordinate was fixed to one; this is not automatically the distance obtainable by perturbing only the original features. Question 4 derives different optimizers and different feature-space margins on the same two observations.
The role of both labels is also substantive. For a single positive example, choosing w zero and minimizes the standard objective at zero, and b need not be bounded. Such minimizers exist, but their feature hyperplane is degenerate. The geometric-margin equivalence just proved is not a statement about that case. If opposite labels share the same input, the two hard constraints contradict one another and there is no feasible pair. The next examples make the failure of a separation assumption explicit.
6. What the theorems certify
The perceptron theorem certifies a finite number of mistake-or-tie updates and termination of the specified fair scan on strictly separable finite data. Its proof does not minimize the standard hard-margin objective and does not claim that the final parameter is a maximum-margin solution.
The hard-margin theorem supplies an attained optimum for its stated feasible model, with a unique feature normal. It says neither that every classification dataset is separable nor that a perfect training separator predicts new data accurately. No soft margin, kernel, duality, KKT theorem, probability bound or floating-point stability result is being used.
Common checks are therefore mathematical checks of the model itself:
- Write the tie convention before interpreting a zero signed score.
- Include the constant coordinate when computing the perceptron radius R.
- Count updates separately from visits and verify an entire no-update pass.
- Normalize w and b together when comparing the same hyperplane.
- Check whether the objective penalizes the intercept.
- Use both-label and strict-separation hypotheses when applying the margin optimizer theorem.
7. Questions and complete Solutions
Question 1: a least-squares score can choose the wrong boundary
Take one-dimensional inputs and labels . Fit the affine least-squares score using the existing normal-equation theorem. Write its two-by-two system, calculate all four predictions with the stated positive tie rule, and compare it with the score . Explain what a zero score predicts for each possible label, and why a zero feature normal has no hyperplane-distance formula.
Solution. The design rows are , with coefficient vector . Direct finite sums give
The first normal equation gives . Substituting into the second gives , so
There are no ties in these four scores. Thresholding gives , with the single error at input one and empirical error . The normal-equation result guarantees the optimum of the numerical squared-loss problem, not the optimum of label-error count.
The score has values at the same inputs. Every signed score is positive, so it has zero classification error. Its large numerical output at100 can be costly for squared loss while remaining a correct positive prediction. There is no contradiction between the two objectives.
At a zero score our classifier outputs plus one: a positive label is correct and a negative label is incorrect. Yet the signed product is zero for both, so it cannot distinguish them. Finally w zero makes the score constant. Its zero level is either empty or all of the line, and dividing by is invalid. A constant prediction rule can be defined, but the nonzero-normal distance proposition cannot be applied to it.
Question 2: follow every visit before using an update bound
Use the ordered list . Start the stated augmented perceptron at with . Record each visit, its signed score, and the resulting parameter. Stop only after a full no-update pass. Give a unit separator, R and , and compare the actual updates and visits with their bounds.
Solution. The signed score is evaluated before any update at that visit. The full calculation is:
| Pass | Index | Signed score before update | Update? | Parameter after visit |
|---|---|---|---|---|
| 1 | 1 | yes | ||
| 1 | 2 | yes | ||
| 1 | 3 | yes | ||
| 2 | 1 | no | ||
| 2 | 2 | yes | ||
| 2 | 3 | no | ||
| 3 | 1 | no | ||
| 3 | 2 | no | ||
| 3 | 3 | no |
For example, the second visit uses with label minus one, so it subtracts that vector from . The third visit has positive label and score zero; it is an update even though the positive tie rule predicts that label correctly.
There are updates, three passes and nine visits. Take
Thus . The first two augmented vectors have norm and the third has norm , so . The theorem gives , a valid but loose bound. The visit bound using the actual T is , while the actual number is nine.
The final pass matters: its three positive signed scores certify the whole list for one fixed parameter. Stopping at the earlier positive score of a single observation would not provide that certificate. The final parameter is a strict separator, but this computation has not established a maximum-margin optimization claim.
Question 3: distinct-input failure and inconsistent-label cycling
First give positive labels to and negative labels to . Prove that no affine score strictly separates these XOR data. Next use the single one-dimensional input zero twice, with labels plus one and minus one in that order. Show exactly how the zero-initialized perceptron cycles under this repeated scan, and identify the theorem hypothesis that fails.
Solution. Write the affine parameters as . The positive constraints would be and . Adding them gives . The negative constraints would be and . Adding them gives . This is impossible. Distinct inputs alone do not imply affine strict separability.
For the repeated zero input, both augmented vectors are , with opposite labels. Starting at , the first positive signed score is zero, so the update gives . The negative example then has signed score minus one, so subtracting gives again. Each complete pass repeats
Every pass has updates, so the specified stopping test never succeeds. There cannot be a unit v and positive with both and ; adding would give . The update theorem is therefore inapplicable. Normalizing the recurring zero parameter would also be undefined.
The second data list is more than a failure of affine geometry: one deterministic label rule at the same input cannot output two different labels simultaneously. Neither example is repaired by citing a theorem whose separation hypothesis is false. No nonlinear or kernel construction is claimed here.
Question 4: the bias penalty changes the separating line
In one dimension take a positive example at1 and a negative example at minus five. Derive the optimizer of standard hard margin with unpenalized b, including its feature-space geometric margin. Then minimize under the same constraints and compare boundaries and margins. Finally delete the negative example and explain the resulting degeneracy without falsely claiming nonexistence.
Solution. The two constraints are
Adding gives , so . The standard objective is therefore minimized at , provided it is feasible. At that value the separate constraints require and , hence . Both are equalities, proving feasibility and the unique b in this particular example. The boundary is ; each example is distance three from it. Equivalently the functional minimum is one and . The standard objective value is .
For the augmented objective, the positive constraint and Cauchy–Schwarz imply
Equality requires and , so the only possible equality pair is . It also satisfies the other constraint, since . Hence it is the unique augmented-norm optimizer, with objective value .
Its boundary is . The positive point is distance two and the negative point distance four from it, so the minimum feature-space margin is two. Both classifiers have zero training error, but standard feature-space margin three is larger. Their objective values belong to different objectives and should not be treated as competing measurements of the same loss.
The augmented margin at is , whereas its feature margin is two. At the standard pair the augmented norm is , giving augmented margin . These different values display the two geometries explicitly.
If the negative example is deleted, the only constraint is . All pairs attain objective zero in the standard problem. Existence has not failed, but b is not unique and the feature normal is zero. The nondegenerate hyperplane-margin theorem was stated for both labels and cannot be used here. In fact fixed unit normal with b increasing gives arbitrarily large feature margins for this one point; there is no finite largest such margin among genuine hyperplanes. This is precisely why the constant-predictor optimum and the both-label geometric equivalence are different cases.
8. Connections and the boundary of this supplement
The same real feature table can support numerical regression, labelled projection, learned distance geometry and binary classification. The objective and the output determine which calculation is appropriate. Fisher's direction need not solve the hard-margin constraints, and a nearest-neighbor squared-distance margin is not the geometric quantity derived here.
For computation with smooth quadratic losses, continue with gradient descent on quadratics. For distinguishing fitting from evaluation, use validation and ridge regression. Those connections do not turn the finite-data theorems in this note into statistical prediction guarantees.
The proved endpoints are binary affine geometry, the specified perceptron update and stopping bounds, and attained standard hard margin under finite strict separation with both labels. Soft margins, kernels, dual formulations, multiclass models and probabilistic generalization are separate subjects. The four Questions and their complete solutions above are original.