Hypothesis Class
A hypothesis class H is a set of functions from X to Y.
From Candidates to One Predictor
A learner does not always choose from every possible predictor. Instead, it may be restricted to a hypothesis class H, a set of functions from X to Y. Each function is a candidate rule for mapping inputs to predictions. Learning then becomes a controlled selection problem: examine the candidates, measure their performance on the training sample, and choose one.
This restriction matters because a finite class contains a finite number of candidates. A class can still represent a broad modeling idea while being finite. For example, predictors implementable by a C++ program using at most 10^9 bits of code form one example described in the source. Axis-aligned rectangles also become a finite class when their real-valued parameters are represented using a 64-bit floating-point representation.
Compressing Training Information
A compression scheme of size k describes how to reconstruct a hypothesis using only k selected labeled examples from the full training set. It uses two functions. Function A selects k indices from the complete training set. Function B receives the corresponding selected examples and produces a reconstructed hypothesis h' in H.
The key point is that A does not directly return the final hypothesis. A identifies which training examples are retained. B then uses those retained examples to construct a hypothesis in the class. The rest of the training set is not used as input to B for the reconstruction step.
Tracing a Size-2 Scheme
Consider a generated training set with several labeled examples and a compression scheme of size 2.
Selection: Function A examines the full training set and selects two example indices.
Retention: The two indexed examples, including their labels, become the compressed representation of the training information.
Reconstruction: Function B receives those two selected examples and produces a hypothesis h' that belongs to H.
Interpretation: The scheme has compressed the information used for reconstruction to two labeled examples; it has not necessarily compressed the original training set itself into two examples for every purpose.
A performs selection, while B performs reconstruction. The size is 2 because two labeled examples are selected.
Checking the Original Sample
Reconstruction is not complete merely because B returns a hypothesis in H. The reconstructed hypothesis must also have zero loss on the original training set. The check therefore compares h' with every example in the full training set, not only with the k examples selected by A.
This requirement separates two roles for the data. The selected examples are sufficient inputs for reconstruction, while the complete original sample is used to verify the zero-loss condition. A hypothesis that fits only the retained examples has not yet met the compression-scheme requirement.
ERM Within a Finite Class
Empirical risk minimization, or ERM, examines how each candidate in a fixed collection performs on the training sample and chooses a hypothesis with minimum empirical risk. When the hypothesis class is finite, the learner is choosing from a finite number of candidates rather than from an unrestricted collection.
Restricting the learner to a finite class can limit overfitting because the learner has fewer candidate hypotheses available for selection. The class may still be large, so finiteness does not mean that the modeling idea is extremely narrow. The learning question remains whether the training-based choice will also perform well beyond the observed sample.
Choosing Among Three Candidates
A generated finite class contains h1, h2, and h3. On one training sample, their empirical risks are 2, 0, and 1 respectively.
Evaluate: ERM considers the empirical risk of each candidate on the observed training sample.
Compare: The smallest listed empirical risk is 0, achieved by h2.
Select: ERM selects a hypothesis with minimum empirical risk, so h2 is an ERM result for this generated example.
Limit of the conclusion: The selection establishes performance on the training sample. It does not by itself establish low true risk.
For this generated sample, ERM selects h2 because it has the smallest empirical risk.
Realizability and Its Consequence
Realizability places a hypothesis h* with zero true risk inside the hypothesis class H. The sample is drawn from the distribution and labeled by the target rule.
Because h* has zero true risk, it has empirical risk zero on the random training sample with probability 1. Thus ERM has an available candidate that makes no errors on the observed sample. Since ERM chooses a hypothesis with minimum empirical risk, every ERM result hS also has empirical risk zero in this setting.
Sample Fit Versus Distribution Performance
Empirical risk describes a hypothesis's performance on the observed training sample. True risk describes its performance under the data distribution. Therefore, zero empirical risk means that the hypothesis makes no errors on the available sample, while low true risk means that it performs well beyond that sample under the distribution.
Separating the Two Claims
A generated hypothesis makes no errors on the training sample.
Sample-level statement: The hypothesis has zero empirical risk because its predictions agree with the labels in the observed sample.
Distribution-level question: To discuss true risk, ask how the same hypothesis performs under the data distribution, including examples not present in the observed sample.
Correct conclusion: Zero empirical risk is an intermediate fact. It is not the same statement as low true risk.
A perfect training fit does not, by itself, establish performance beyond the training sample.
Why Class Size Affects Data Needs
For a finite hypothesis class, the relationship between training-based selection and performance beyond the sample is tied to two conditions: the size of the class and the amount of training data. As the number of candidate hypotheses grows, the required amount of training data grows in relation to the size of the class.
The reason to track class size is that ERM is selecting among all available candidates. A finite class gives a controlled candidate set, but a larger finite set still gives the learner more candidates to compare. The sample-size requirement therefore cannot be discussed independently of how many hypotheses the class contains.
Mistakes in Reasoning
Treating A as the function that directly constructs the hypothesis.
In the compression scheme, A performs selection, while B uses the selected labeled examples to produce h' in H.
Fix:
Remember the division of labor: A selects; B reconstructs.Checking zero loss only on the selected examples.
The zero-loss requirement applies to the original training set, not just the compressed subset.
Fix:
Evaluate the reconstructed hypothesis against every example in the original training set.Concluding that zero empirical risk means zero true risk.
Empirical risk concerns the sample, whereas true risk concerns the data distribution.
Fix:
State separately what was established on the sample and what remains to be established under the distribution.Assuming realizability guarantees that every hypothesis in H has zero empirical risk.
Realizability guarantees an available zero-risk target hypothesis, and therefore a zero-empirical-risk benchmark on the sample. It does not say that every candidate has zero risk.
Fix:
Use h* to explain why the ERM minimum is zero under the stated setting.Ignoring the size of the hypothesis class when discussing training data.
The required amount of training data grows in relation to the size of the class.
Fix:
Always identify both the candidate-class size and the available training amount.
Practice the Selection Logic
A hypothesis class H is finite. It contains h1, h2, and h3. On a training sample, h1 has empirical risk 1, h2 has empirical risk 0, and h3 has empirical risk 2. Answer the following: Which hypothesis can ERM select? If the setting is realizable and h* is in H with zero true risk, what empirical-risk conclusion can you make about every ERM result? Finally, does either conclusion alone establish low true risk?
Hints
- ERM chooses a hypothesis with minimum empirical risk.
- Under realizability, h* has empirical risk zero on the random sample with probability 1.
- Keep empirical risk tied to the observed sample and true risk tied to the data distribution.
What do you think happens?
If realizability gives ERM access to a hypothesis with zero empirical risk, what empirical risk must an ERM result have in this setting?
Reveal answer
Answer: It has empirical risk zero.
The realizable hypothesis h* provides a zero-empirical-risk candidate on the random sample with probability 1. ERM chooses a minimum-empirical-risk hypothesis, so every ERM result also has empirical risk zero. This does not by itself establish zero true risk.
Key Takeaways
- A hypothesis class H is a set of functions from X to Y.
- A size-k compression scheme uses A to select k training-example indices and B to reconstruct a hypothesis in H from the corresponding labeled examples.
- The reconstructed hypothesis must have zero loss on the entire original training set.
- ERM chooses a minimum-empirical-risk hypothesis from a finite class; under realizability, every ERM result has zero empirical risk on the random sample with probability 1.
- Zero empirical risk is a statement about the observed sample, not the same as low true risk under the data distribution.
- The required training amount grows in relation to the size of the finite hypothesis class.
Key Takeaways
- A hypothesis class is a set of candidate functions mapping X to Y.
- Compression uses A for selecting k labeled examples and B for reconstructing a hypothesis that has zero loss on the original sample.
- Finite-class ERM selects a candidate with minimum empirical risk.
- Under realizability, ERM reaches zero empirical risk on the sample with probability 1, but this does not automatically imply low true risk.
- The amount of training data needed is tied to the size of the hypothesis class.