Concepts / Introduction to PAC Learning

Introduction to PAC Learning

PAC learnability is a definition involving a hypothesis class H, a function m_H, and a learning algorithm.

  • Programming

From Examples to a Guarantee

PAC learning is a precise way to describe when a hypothesis class H can be learned by an algorithm. It does not merely say that an algorithm performs well on some examples. It specifies how many labeled examples are needed, how accurate the returned hypothesis should be, and how confident we should be in that accuracy.

The central process is this: examples come from a distribution D over an instance space X and receive labels from a target function f. A learning algorithm receives enough labeled examples and returns a hypothesis h from the hypothesis class H. PAC learnability requires a guarantee about the loss of h, not just its behavior on the examples used for training.

requiresinputsearch spacesets targetreturnsmust satisfyHhypothesis classm labeled examplesm at least m_Hlearning algorithmreceives sampleshreturned hypothesisloss at most epsilonwith probability at least 1minus deltam_H(epsilon, delta)sample thresholdDdistribution over Xftarget functionepsilon, deltaaccuracy and confidence
How do the hypothesis class, sample threshold, data distribution, target function, accuracy, confidence, and learning algorithm connect to a returned hypothesis?

The PAC Symbols

Each symbol in the definition has a distinct job. H is the hypothesis class: the collection of hypotheses the learning system can consider. The function m_H determines the sample threshold. For chosen accuracy epsilon and confidence delta, the learner must receive at least m_H(epsilon, delta) examples. D is a distribution over the instance space X, and f is the labeling function that supplies the labels. The algorithm returns h, the learned hypothesis.

SymbolRole in the definition
HHypothesis class available to the learner
m_HFunction that determines the required sample threshold
epsilonRequested accuracy parameter
deltaAllowed confidence-failure parameter
DDistribution over the instance space X
fTarget labeling function
hHypothesis returned by the learning algorithm

The main objects in the PAC learning definition.

depends ondepends onlabels are generated overcontainssample function forevaluates behavior undertarget compared withmust achievesets upper boundsets failure probabilityHhypothesis classDdistribution over Xhreturned hypothesisloss at most epsilonwith probability at least 1minus deltam_Hsample threshold functionftarget labeling functionepsilonaccuracy targetdeltaconfidence parameter
What does each symbol represent, and how do the objects relate to the learning guarantee?

Following the Guarantee

A hypothesis class H is PAC learnable when there is a sample-complexity function m_H and a suitable learning algorithm such that, whenever the number of labeled examples m is at least m_H(epsilon, delta), the algorithm returns a hypothesis h whose loss is at most epsilon with probability at least 1 minus delta. This requirement must hold for every allowed choice of epsilon and delta, every distribution D over X, and every labeling function f for which the realizable assumption holds.

Reading a PAC Guarantee

Suppose a learner is being analyzed with a hypothesis class H, accuracy parameter epsilon, confidence parameter delta, and a sample-complexity function m_H. What must be checked before the guarantee can be applied?

Choose the learning settings: Specify the desired accuracy epsilon and confidence parameter delta.

Check the sample threshold: Determine the threshold supplied by m_H(epsilon, delta), then check that the available number of labeled examples m is at least that threshold.

Check the data assumptions: The examples must be understood relative to a distribution D over X and a target labeling function f, and the realizable assumption must hold with respect to H, D, and f.

Interpret the result: After learning, the returned hypothesis h is guaranteed to have loss at most epsilon with probability at least 1 minus delta.

The definition supplies a conditional guarantee. It does not claim a particular numerical sample bound unless m_H is known.

Why Realizability Matters

The realizable assumption is a condition connecting H, D, and f. It says that the target labeling situation is compatible with the hypothesis class being considered. Under this assumption, the class contains a hypothesis capable of representing the target labeling behavior, so a hypothesis with zero training error can exist for the labeled examples.

This condition matters because the stated PAC guarantee is made for the realizable setting. Without it, a learner might be asked to find a hypothesis in H that agrees with labels that no hypothesis in H can represent. In that situation, zero training error is not guaranteed to be achievable, so the definition would need a different assumption or guarantee.

fitspermitscannot be represented bymay forceTarget labelingrepresented within HHcontains a matchinghypothesishzero training error canexistTarget labelingnot represented within HHno matching hypothesistraining errorzero error is notguaranteed
What changes when the target labeling is compatible with H, and why can a zero-training-error hypothesis then exist?

Feature Learning as Representation

A machine learning method cannot work directly with an unspecified instance space. It needs instances to be expressed in a feature representation. Feature learning addresses this preparation step by learning a function psi that maps instances from X into d-dimensional feature vectors.

Before the mapping, an item is described only as an element of X. After the mapping, the same item is available as a vector with d coordinates. The learned function psi is therefore a transformation that creates a usable description of each instance. The purpose is to produce a representation that supports a suitable hypothesis class for the task.

inputmaps tox in Xinstancepsilearned mappingfeature vectord coordinates
How does an instance move from the original instance space into a d-dimensional feature vector space?

Learning Versus Selecting Features

ApproachStarting pointMain operation
Feature selectionA predefined feature space R^dChooses some of the available features
Feature transformationA predefined feature space R^dChanges individual features
Feature learningInstances in XLearns a function psi that creates the representation

Feature selection and feature transformation assume that a feature space has already been designed. Selection chooses among available features, while transformation changes individual features. Feature learning starts one step earlier: it learns how instances from X should be represented in the first place.

feature learningselection or transformationinstances in Xrepresentation not fullydefinedlearned featurevectorcreated by psipredefined R^dfeature space alreadyexistsselected ortransformed featuresoperation within R^d
What is the difference between learning a representation from instances and operating on a feature space defined in advance?

Polynomial Features

Polynomial regression illustrates the general pattern of constructing features first and training a linear predictor on top of them. An input x can be mapped into the constructed feature vector consisting of 1, x, x squared, and continuing through x to the power of d. The monomial construction supplies the representation; the later linear predictor operates on that representation.

mapcreatesfeedsxinputmonomial mappingconstructed representation1, x, x², ..., xᵈfeature vectorlinear predictorregression hypothesis
How does an input x become a constructed feature vector, and how do those features feed into the regression hypothesis?

Separating the Two Roles

Explain which part of polynomial regression is the representation step and which part is the prediction step.

Represent the input: The monomial construction maps x into the feature vector 1, x, x², ..., xᵈ.

Apply the predictor: A linear predictor operates on the constructed feature vector to form the regression hypothesis.

Identify the feature-learning idea: The mapping into the constructed feature vector is the representation part. The later predictor is a separate part of the learning system.

Polynomial regression demonstrates that constructing a representation and learning a predictor on that representation are distinct roles.

Common Misreadings

  • Treating PAC learning as a statement about one fixed dataset.

    The guarantee is stated relative to every allowed distribution D and every allowed target function f under the realizable assumption.

    Fix: Track the distribution, target function, accuracy, confidence, sample threshold, and returned hypothesis together.

  • Confusing epsilon with delta.

    Epsilon bounds the permitted loss, while delta controls the probability associated with the guarantee.

    Fix: Remember: epsilon describes accuracy and delta describes confidence.

  • Assuming m_H is automatically a numerical sample count.

    m_H is the function that supplies the threshold for the chosen epsilon and delta.

    Fix: State the condition m at least m_H(epsilon, delta) unless a specific bound has been provided.

  • Calling feature selection feature learning.

    Selection starts with an existing feature space, while feature learning learns a mapping from instances into a feature vector space.

    Fix: Ask whether the procedure begins with instances in X or with a feature space already defined.

  • Treating the polynomial predictor as the feature mapping.

    The monomial construction creates the representation; the predictor acts after that representation exists.

    Fix: Separate the mapping step from the prediction step.

Practice Check

MEDIUM

A learning algorithm receives m labeled examples. Explain what must be true for a PAC guarantee to apply, and identify the roles of H, m_H, epsilon, delta, D, f, and h in the resulting statement.

Hints
  • Start with the sample threshold m at least m_H(epsilon, delta).
  • Include the realizable assumption involving H, D, and f.
  • End with the loss and probability guarantee for h.
EASY

A method begins with instances in X and learns a function psi that maps them into vectors with d coordinates. Is this feature selection, feature transformation, or feature learning? Explain why.

Hints
  • Check whether the feature space was predefined before the method began.
  • Focus on the role of psi.

Key Takeaways

  1. PAC learnability combines a hypothesis class H, a sample-complexity function m_H, and a learning algorithm.
  2. When m is at least m_H(epsilon, delta), the returned hypothesis h must have loss at most epsilon with probability at least 1 minus delta.
  3. The guarantee is stated for distributions D and target functions f under the realizable assumption.
  4. Feature learning learns a mapping psi from instances in X into d-dimensional feature vectors, unlike selection or transformation within a predefined feature space.
  5. Polynomial regression separates feature construction, such as 1, x, x², ..., xᵈ, from the later linear prediction step.

Key Takeaways

  • PAC learning gives a formal accuracy and confidence guarantee for learning a hypothesis class.
  • The sample threshold is supplied by m_H(epsilon, delta), and the learner must return h with loss at most epsilon with probability at least 1 minus delta.
  • The realizable assumption ensures that the target labeling is compatible with H.
  • Feature learning creates a d-dimensional representation from instances, whereas feature selection and transformation begin with a predefined feature space.
  • Polynomial regression illustrates representation construction followed by prediction.