Concepts / Hypothesis Classes and Training Error

Hypothesis Classes and Training Error

Compression in the unrealizable setting seeks minimum error within H, not necessarily zero error.

  • Programming

When Perfect Fit Is Impossible

Compression is easiest to picture in the realizable setting: some hypothesis in the class H labels every training example correctly. The more difficult setting is unrealizable. In that setting, every hypothesis in H makes at least one mistake on the training sequence. The goal is no longer zero training error. Instead, the goal is to reconstruct a hypothesis whose training error is no worse than that of any competing hypothesis in H.

A compression scheme does not need to preserve the entire training sequence. It must preserve enough information to reconstruct a hypothesis with the required training-error guarantee.

The Compression Pipeline

Consider an arbitrary training sequence containing m examples. A compression scheme of size k keeps only the examples selected by A, with no more than k examples surviving the selection step. The reconstruction function B then receives those retained examples and produces a hypothesis h'. The number m may be larger than k, but B does not receive all m examples. The compression guarantee is evaluated on the original training sequence, not only on the retained subset.

inputpreservesprovided toproducesTraining sequencem examplesAselects at most kRetained examplesat most k examplesBuses retained informationh′reconstructed hypothesis
How can an arbitrary training sequence be reduced to at most k retained examples while still reconstructing a useful hypothesis?

Selection and Reconstruction

The functions A and B have different responsibilities. A chooses what information to preserve from the training sequence. It may select examples or encode the selected positions, but its role is selection. B takes the retained information and turns it into a hypothesis. Its role is reconstruction. Confusing these roles makes the compression guarantee difficult to follow: A controls what survives, while B controls how that surviving information becomes h'.

examinesselectsinputreconstructsTraining sequencefull sequenceAselection functionSelected examplesno more than kBreconstruction functionh′hypothesis
How does A select or encode a small part of the training sequence, and how does B use that retained information to reconstruct a hypothesis?

The guarantee is about the quality of h' on the full sequence. It does not claim that the retained examples contain every detail of the original sequence.

The ERM Retention Step

What do you think happens?

Suppose h is an ERM hypothesis and some training examples are misclassified by h. If we retain only the examples that h classifies correctly, what property does h have on the retained subset?

  • It has zero error on the retained subset.
  • It has the same error as on the full sequence.
  • It is no longer a member of H.
Reveal answer

Answer: It has zero error on the retained subset.

The retained subset is defined to contain exactly the examples that h classified correctly. Therefore h is consistent with every retained example, even if it is not consistent with the full original sequence.

Start with an ERM hypothesis h: a hypothesis in H chosen to minimize training error on the original sequence. If the problem is unrealizable, h may still make mistakes. Discard the examples on which h errs and retain the examples on which h is correct. On this retained subset, h is perfectly consistent. The original unrealizable problem has therefore been converted into a realizable problem on the retained examples.

discard h-errorsclassified byFull sequenceh makes errorsRetained subseth is correcthERM hypothesishzero error on subset
How does selecting and retaining a subset of examples make the ERM hypothesis perfectly consistent with that subset even when no hypothesis fits the full training sequence?

Retaining the Correctly Classified Examples

An unrealizable training sequence contains six examples. An ERM hypothesis h makes errors on two of them and is correct on the other four. A realizable compression scheme of size k is available for any sequence on which a hypothesis is perfectly consistent. What happens when the scheme is applied after the two errors of h are discarded?

Choose the ERM: Use h, a hypothesis in H with minimum training error on the original six-example sequence.

Form the retained subset: Keep the four examples that h classifies correctly. On this subset, h has zero error, so the subset is realizable by h.

Apply the realizable scheme: Apply the assumed realizable compression scheme to the retained subset. It selects no more than k examples and reconstructs h′ that is correct on every retained example.

Compare on the full sequence: Any error made by h′ on the original sequence can occur only among the two examples discarded because h erred there. Thus h′ has no more errors than h on the original sequence.

The realizable scheme has produced a hypothesis whose training error on the full sequence is no greater than the ERM's error. The same compression size k is preserved.

Why the Error Guarantee Transfers

The reconstructed hypothesis h′ is guaranteed to be correct on every retained example because the realizable compression scheme is applied to a subset that h labels perfectly. Therefore, any error h′ makes on the original sequence must lie among the discarded examples. Those discarded examples are precisely examples on which h already errs. This shows that h′ cannot have more training error than h.

chooseclassifiesretain correct casesinputreconstructsOriginal sequencepossibly unrealizableERM hminimum error in HCorrect examplesretain h-correct casesRealizable subseth has zero errorRealizable schemesize kh′error no greater than h
How can the minimum-error ERM hypothesis redefine the labels or target problem so that a scheme designed for realizable data can be applied to the retained consistent subset?

Because h was chosen to minimize training error within H, no hypothesis in H has fewer errors than h on the original sequence. Since h′ has no more errors than h, h′ also has minimum training error within H. The construction therefore extends a realizable compression scheme of size k to the unrealizable setting without increasing the compression size.

Common Reasoning Mistakes

  • Assuming that compression requires zero training error on the original sequence.

    In the unrealizable setting, the target is minimum training error within H, not necessarily zero error.

    Fix: Choose an ERM hypothesis and compare the reconstructed hypothesis with that minimum-error benchmark.

  • Treating A and B as the same operation.

    A selects the retained examples, while B maps the retained information to the reconstructed hypothesis.

    Fix: Describe A as the selection step and B as the reconstruction step.

  • Evaluating h′ only on the retained subset.

    The training-error comparison is made on the full original sequence.

    Fix: Use the retained subset to establish correctness there, then examine the discarded examples to compare full-sequence error.

  • Claiming that h′ must be correct on every discarded example.

    The guarantee only forces h′ to be correct on the retained examples. Errors may remain among the discarded examples.

    Fix: Show instead that discarded examples are exactly where h already errs, so h′ cannot have more error than h.

  • Increasing the compression size when moving to the unrealizable setting.

    The construction applies the existing realizable scheme only to the examples correctly classified by h, and the stated result preserves size k.

    Fix: Keep the same size bound k for the realizable compression step.

Practice the Construction

MEDIUM

Explain the transfer argument in your own words. Begin with an arbitrary unrealizable training sequence and an ERM hypothesis h. Identify which examples are retained, state why the retained subset is realizable, describe what the realizable compression scheme returns, and explain why the reconstructed hypothesis has no greater error than h on the original sequence.

Hints
  • Separate the examples where h is correct from the examples where h errs.
  • Use the realizable guarantee only on the retained examples.
  • For the full-sequence comparison, focus on where h′ could still make errors.
  1. A size-k compression scheme keeps at most k examples from an arbitrary training sequence and reconstructs a hypothesis from them. A selects the retained information; B reconstructs the hypothesis. In the unrealizable setting, first choose an ERM hypothesis h. Retain only examples that h classifies correctly, creating a realizable subset. Apply the realizable compression scheme to that subset to obtain h′. Since h′ is correct on the retained examples, any errors it makes on the original sequence can occur only where h already errs. Therefore h′ is no worse than h, and because h is an ERM in H, h′ also achieves minimum training error within H. The compression size remains k.

Key Takeaways

  • A compression scheme of size k retains at most k examples and reconstructs a hypothesis from those examples.
  • A selects the information to preserve, while B maps that information to a reconstructed hypothesis.
  • An ERM hypothesis can make an unrealizable problem realizable by restricting attention to examples it classifies correctly.
  • The reconstructed hypothesis is correct on the retained subset, so its possible errors on the original sequence are confined to examples where the ERM already errs.
  • A realizable compression scheme of size k therefore yields an unrealizable compression scheme of the same size k.