Computational learning theory and fundamentals

Four rules can agree on every training example and still disagree on what to do next. Computational learning theory asks how much evidence a learner needs to choose a rule that works on new cases,…

Chalkboard plots show a fitted line alongside training examples and held-out examples to illustrate generalization.

Four rules can agree on every training example and still disagree on what to do next. Computational learning theory asks how much evidence a learner needs to choose a rule that works on new cases, and how much computation it takes to find that rule. A test score answers a narrower question: how often was this particular rule wrong on these particular cases?

Fit a rule without seeing the test labels

Imagine a simulated gauge that displays a whole number from 0 to 9. A hidden switch turns on at 7 or higher. The learner sees labeled readings, not the switch setting. Its hypothesis class consists of four rules: turn on at 5, 6, 7, or 8. Assuming that one cutoff can explain the labels is an inductive bias. This is supervised learning: each training reading comes with the correct switch state.

Before testing, fix the selection rule: count the training mistakes for each cutoff, choose the smallest count, and break ties by choosing the lowest cutoff. This is empirical risk minimization with zero-one loss: a wrong prediction costs one, a correct one costs zero. Here the search takes four passes over the training examples. A sample-size result alone would not tell us how long a search through a much larger class takes.

Synthetic gauge readings (0 = off, 1 = on)
SplitReadingsTrue states, in orderPredictions at cutoff 5
Training0, 1, 4, 8, 90, 0, 0, 1, 10, 0, 0, 1, 1
Held-out test2, 5, 7, 90, 0, 1, 10, 1, 1, 1

There are no training readings between 4 and 8. All four candidates therefore make zero training mistakes, and the tie-break selects 5. Freeze that rule. On the test set, a reading of 5 triggers a false alarm. The empirical training error is 0/5 = 0%; the test error is 1/4 = 25%. A value such as 9 can recur in separate observations. What matters is that no test observation helped choose the cutoff.

What is the population error?

Suppose each of the ten readings is equally likely in use. We know the simulator, so we can check all ten. Only 5 and 6 produce a false alarm. The rule’s population error is 2/10 = 20%, not 25%. We know that number from the specified distribution and switch setting, not from inspecting the test score. If the gauge spends more time at 5 or 6, the population error rises even though the table does not change.

What would a learning guarantee require?

A probably approximately correct (PAC) guarantee concerns repeated random draws of training data. Consider a different experiment: draw independent labeled examples from the same distribution that will generate future cases, fix a finite hypothesis class in advance, and assume it contains a rule that always labels correctly. Under those assumptions, a learner that returns any rule with zero training mistakes has a useful guarantee.

For example, a rule with error greater than 10% has less than a 0.9 chance of being right on one draw. Its chance of surviving m independent draws without a mistake is at most 0.9m. With four candidates, the chance that any such bad rule survives is at most four times that amount. Using the looser exponential bound, 44 draws suffice for at least 95% confidence that a consistent rule’s population error is at most 10%. This is a sufficient count, not a minimum. The five training readings above were chosen for illustration, not sampled to establish that guarantee.

Noise can leave no consistent cutoff. A change in the gauge can invalidate the distribution assumption. And if you change the rule after inspecting the test errors, that set is now part of model selection. When comparing machine learning algorithms, tune on training and validation data, then evaluate once on an untouched test set. The same separation applies to preprocessing: fit principal component analysis (PCA) on training data, then apply the fitted transformation to held-out cases.

Sources and further reading

Shai Shalev-Shwartz and Shai Ben-David develop the finite-class argument in chapters 2 and 3 of Understanding Machine Learning: From Theory to Algorithms. For the specific danger of tuning decisions to a test set, see Cynthia Dwork and colleagues’ research on adaptive holdout reuse.

As an Amazon Associate I earn from qualifying purchases. Understanding Machine Learning: From Theory to Algorithms (first edition, hardcover) on Amazon US.