We generalize the PAC learning problem of finding an hypothesis from a finite hypothesis family to the one from a countable hypothesis family.

Problem Setting

  1. X:\mathcal{X}: the input space.

  2. Y≐{−1,1}:\mathcal{Y} \doteq \{-1, 1\}: the output space.

  3. Z≐X×Y:\mathcal{Z} \doteq \mathcal{X} \times \mathcal{Y}: the product space of X\mathcal{X} and Y\mathcal{Y}.

  4. D:\mathcal{D}: an unknown distribution defined on X×Y\mathcal{X} \times \mathcal{Y}.

  5. H:\mathcal{H}: an countable family of hypothesis, s.t., each h∈Hh \in \mathcal{H} is a function from X\mathcal{X} to Y\mathcal{Y}.

  6. ℓ:Y×Y→[0,1]\ell: \mathcal{Y} \times \mathcal{Y} \rightarrow [0, 1], a loss function that takes two points in Y\mathcal{Y} and outputs a value between 00 and 11.

  7. LD(h):L_\mathcal{D} (h): the expected loss of a hypothesis hh is defined as

    LD(h)=E(x,y)∼D[ℓ(h(x),y)] L_\mathcal{D} (h) = \mathbb{E}_{ (x, y) \sim \mathcal{D} } [ \ell( h(x), y) ]

    where (x,y)∼D(x, y) \sim \mathcal{D} implies that the pair (x,y)∈Z(x, y) \in \mathcal{Z} is sampled according to the distribution D\mathcal{D}.

  8. h∗≐arg⁡min⁡h∈HLD(h):h^* \doteq \arg\min_{h \in \mathcal{H} } L_\mathcal{D} (h): the hypothesis that minimize the expected loss.

  9. μh:\mu_h: an alias for LD(h)L_\mathcal{D} (h), when the distribution D\mathcal{D} discussed in the context is unique.

  10. B(μh,ϵ)≐{r∈R:∣r−μh∣<ϵ}:B(\mu_h, \epsilon) \doteq \{ r \in \mathbb{R} : |r - \mu_h | < \epsilon \}: an open ball, which is an open interval in R\mathbb{R} centered at μh\mu_h with length 2ϵ2 \epsilon, where ϵ>0\epsilon > 0.

  11. S∼Dn:S \sim \mathcal{D}^n: a set of nn i.i.d samples drawn from D\mathcal{D}, where n∈N+n \in \mathbb{N}^+ is some positive integer. In particular, when S∼DnS \sim \mathcal{D}^n, it can be represented as

    S={(x1,y1),(x2,y2),...,(xn,yn):(xi,yi)∼D,∀i∈[n]}. S = \{ (x_1, y_1), (x_2, y_2), ..., (x_n, y_n) : (x_i, y_i) \sim \mathcal {D}, \forall i \in [n] \}.

    We also view SS as a point in Zn\mathcal{Z}^n.

  12. LS(h)≐1∣S∣∑(x,y)∈Sℓ(h(x),y):L_{S}(h) \doteq \frac{1}{ |S| } \sum_{ (x, y) \in S } \ell( h(x) , y ) : the empirical loss of a hypothesis hh on a sample set SS.

  13. Given a h∈Hh \in \mathcal{H}, its restriction on C⊂X\mathcal{C} \subset \mathcal{X} is a function hSh_S defined on SS, such that

hC(x)=h(x),∀x∈C h_\mathcal{C} (x) = h(x), \forall x \in \mathcal{C}
  1. The restriction of H\mathcal{H} on C\mathcal{C} is the set of possible restriction of a function in H\mathcal{H} to C\mathcal{C}

    HC={hC:C→Y:h∈H} \mathcal{H}_\mathcal{C} = \{ h_\mathcal{C} : \mathcal{C} \rightarrow \mathcal{Y} : h \in \mathcal{H} \}

    As Y={−1,+1}\mathcal{Y} = \{ -1, +1 \}, the set of possible functions defined on C\mathcal{C} is bounded by 2n2^{n}. Hence,

    ∣HC∣≤2n. |\mathcal{H}_\mathcal{C} | \le 2^{n}.
  2. The growth function ΠH(n):N+→N+\Pi_{\mathcal{H} } (n): \mathbb{N}^+ \rightarrow \mathbb{N}^+ of H\mathcal{H} is defined as

ΠH(n)=max⁡C⊂X,∣C∣=n∣HC∣ \Pi_{\mathcal{H} } (n) = \max_{\mathcal{C} \subset \mathcal{X}, |C| = n} | \mathcal{H}_\mathcal{C} |

Ideally, we would like to find h∗h^*. The problem is difficult, as

  • The space X×Y\mathcal{X} \times \mathcal{Y} could be infinite.
  • The distribution D\mathcal{D} is unknown.

To deal with the possibly infinite space X×Y\mathcal{X} \times \mathcal{Y} and the unknown distribution D\mathcal{D}, we investigate H\mathcal{H} on a finite sample set SS. Due to the randomness inherited in sampling SS, we allow our solution to be approximate and to make error. For a given pair of parameters of ϵ>0\epsilon > 0 and δ>0\delta > 0, we relax the goal to designing an (ϵ,δ)(\epsilon, \delta)-learning algorithm AA that returns an h′h', that is

  • ϵ\epsilon-approximate: μh′≤μh∗+ϵ\mu_{h'} \le \mu_{h^*} + \epsilon,
  • probably correct: AA return an h′h' that does not satisfies the above condition with probability at most δ\delta.

Combined, AA should return an ϵ\epsilon-approximate solution h′h' with probability at least 1−δ1 - \delta.

The Algorithm

An (ϵ,δ)(\epsilon, \delta) approximate algorithm AA

  1. Draw a set SS of n=n = samples independently from D\mathcal{D}.
  2. Return an h′h' such that
h′=arg⁡min⁡h∈HLS(h) h' = \arg\min_{h \in \mathcal{H} } L_{S} (h)

A key result of the algorithm states that LS(h)L_S(h) is a good approximation of μh\mu_h for all h∈Hh \in \mathcal{H} simultaneously.

Theorem. If n≥n \ge, then

Pr⁡S∼Dn[∃h∈H:LS(h)∉B(μh,ϵ/2)]≤δ \Pr_{S \sim \mathcal{D}^n } [ \exists h \in \mathcal{H} : L_S(h) \notin B(\mu_h, \epsilon / 2 ) ] \le \delta

An immediate corollary is that h′h' is ϵ\epsilon-approximate with probability at least 1−δ1 - \delta:

μh′≤LS(h′)+ϵ2≤LS(h∗)+ϵ2≤μh∗+ϵ. \mu_{h'} \le L_S(h') + \frac{\epsilon}{2} \le L_S(h^*) + \frac{\epsilon}{2} \le \mu_{h^*} + \epsilon.

Proof of The Theorem

The proof relies on a technique called double sampling. Alongside with SS, we create another sample set S′∼DnS' \sim \mathcal{D}^n independently, termed the "ghost sample". Let

S={(x1,y1),(x2,y2),...,(xn,yn)} S = \{ (x_1, y_1), (x_2, y_2), ..., (x_n, y_n) \}

and

S′={(x1′,y1′),(x2′,y2′),...,(xn′,yn′)}. S' = \{ (x_1', y_1'), (x_2', y_2'), ..., (x_n', y_n') \}.

Then, we define

  1. σ:\sigma: a random swap that exchanges the ii-th (i∈[n]i \in [n]) element of SS and S′S' independently with probability 0.5. Call the resulting sample sets σS\sigma S and σS′\sigma S'. Let σS[i]\sigma S[i] (σS′[i]\sigma S'[i]) be the ii-th element of σS[i]\sigma S[i] (σS′[i]\sigma S'[i]). SoPr⁡[σS[i]=(xi,yi)∧σS′[i]=(xi′,yi′)]=0.5Pr⁡[σS[i]=(xi′,yi′)∧σS′[i]=(xi,yi)]=0.5 \Pr \left[ \sigma S [i] = (x_i, y_i) \wedge \sigma S'[i] = (x_i', y_i') \right] = 0.5 \\ \Pr \left[ \sigma S [i] = (x_i', y_i') \wedge \sigma S'[i] = (x_i, y_i) \right] = 0.5

We use the gap of ∣LσS(h)−LσS′(h)∣|L_{\sigma S} (h) - L_{\sigma S'} (h)| as a proxy of ∣LS(h)−μh∣|L_S(h) - \mu_h|. This enables us to focus on finite sets SS and S′S' without worrying about the infinite size of H\mathcal{H}.

For convenience, we use Pr⁡S[⋅]\underset{S}{\Pr}[\cdot] (Pr⁡S′[⋅]\underset{S'}{\Pr}[\cdot]) as shorthand for Pr⁡S∼Dn[⋅]\underset{S \sim \mathcal{D}^n}{\Pr}[\cdot] (Pr⁡S′∼Dn[⋅]\underset{S' \sim \mathcal{D}^n}{\Pr}[\cdot]). The road map of our proof is as follows.

Lemma 1.

Pr⁡S[∃h:LS(h)∉B(μh,ϵ)]≤2max⁡S,S′∈ZnPr⁡σ[∃h:∣LσS(h)−LσS′(h)∣≥ϵ2] \Pr_{S}[ \exists h : L_S(h) \notin B(\mu_h, \epsilon ) ] \le 2 \max_{S, S' \in \mathcal{Z}^n } \Pr_\sigma \left[ \exists h : |L_{ \sigma S} (h) - L_{ \sigma S' } (h) | \ge \frac{\epsilon}{2} \right]

On the left hand side of the inequality, the probability measures the event of a random set SS sampling from D\mathcal{D}. On the right hand side, we can pick a fixed pair of SS and S′S' that maximize

Pr⁡σ[∃h:∣LσS(h)−LσS′(h)∣≥ϵ2], \Pr_\sigma \left[ \exists h : |L_{ \sigma S} (h) - L_{ \sigma S' } (h) | \ge \frac{\epsilon}{2} \right],

and the probability measures the event of the random swap σ\sigma. Fixing SS and S′S' significantly simplifies the structure of H\mathcal{H}. By Hoeffding inequality and union bound, we will prove that

Lemma 2. For any fixed pair of S,S′∈ZnS, S' \in \mathcal{Z}^n,

Pr⁡σ[∃h:∣LσS(h)−LσS′(h)∣≥ϵ2]≤2ΠH(2n)exp⁡(−n2ϵ22) \Pr_\sigma \left[ \exists h : |L_{ \sigma S} (h) - L_{ \sigma S' } (h) | \ge \frac{\epsilon}{2} \right] \le 2 \Pi_\mathcal{H} (2n) \exp( - \frac{n^2 \epsilon^2 }{2} )

Proof of Lemma 1.

The proof of Lemma 1 consists of three steps.

Step 1
Pr⁡S[∃h:LS(h)∉B(μh,ϵ)]≤2Pr⁡S,S′[∃h:LS(h)∉B(μh,ϵ)∧LS′(h)∈B(μh,ϵ/2)]. \Pr_{S}[ \exists h : L_S(h) \notin B(\mu_h, \epsilon ) ] \le 2 \Pr_{S , S'} [ \exists h : L_S (h) \notin B(\mu_h, \epsilon ) \wedge L_{S'} (h) \in B(\mu_h, \epsilon / 2) ].

Proof. By Hoeffding inequality, for a fixed h∈Hh \in \mathcal{H}, when n≥2ϵ2ln⁡4n \ge \frac{2}{\epsilon^2} \ln 4

Pr⁡S′[LS′(h)∉B(μh,ϵ/2)]≤2exp⁡(−2n(ϵ2)2)=2exp⁡(−nϵ22)≤12 \Pr_{S'} [ L_{S'} (h) \notin B(\mu_h, \epsilon / 2) ] \le 2 \exp \left(- 2 n \left( \frac{\epsilon }{ 2 } \right)^2 \right) = 2 \exp \left( - \frac{n \epsilon^2}{2} \right) \le \frac{1}{2}

It follows that

Pr⁡S,S′[∃h:LS(h)∉B(μh,ϵ)∧LS′(h)∈B(μh,ϵ/2)]≥12Pr⁡S[∃h:LS(h)∉B(μh,ϵ)] \Pr_{S , S'} [ \exists h : L_S (h) \notin B(\mu_h, \epsilon ) \wedge L_{S'} (h) \in B(\mu_h, \epsilon / 2) ] \ge \frac{1}{2} \Pr_{S}[ \exists h : L_S(h) \notin B(\mu_h, \epsilon ) ]

□\square

Remark: Mathematically, I don't know how to make prove this step rigorously. Suppose that for every i∈[n]i \in [n], we know that the events EiE_i and FiF_i are measurable and independent. If Pr⁡[Fi]≥1/2\Pr[ F_i ] \ge 1 / 2, then Pr⁡[Ei∧Fi]≥1/2\Pr[ E_i \wedge F_i ] \ge 1 / 2. But, can we claim that

Pr⁡[∪(Ei∧Fi)]≥12Pr⁡[∪Ei]. \Pr[ \cup (E_i \wedge F_i) ] \ge \frac{1}{2} \Pr[ \cup E_i ].
Step 2
Pr⁡S[∃h:LS(h)∉B(μh,ϵ)∧LS′(h)∈B(μh,ϵ/2)]≤Pr⁡S,S′[∃h:∣LS(h)−LS′(h)∣≥ϵ2] \Pr_{S} [ \exists h : L_S (h) \notin B(\mu_h, \epsilon ) \wedge L_{S'} (h) \in B(\mu_h, \epsilon / 2) ] \le \Pr_{S, S'} \left[ \exists h : |L_S (h) - L_{S'} (h) | \ge \frac{\epsilon}{2} \right]

Proof. Observe that

{∃h:LS(h)∉B(μh,ϵ)∧LS′(h)∈B(μh,ϵ/2)}⊂{∃h:∣LS(h)−LS′(h)∣≥ϵ2}. \{ \exists h : L_S (h) \notin B(\mu_h, \epsilon ) \wedge L_{S'} (h) \in B(\mu_h, \epsilon / 2) \} \subset \left\{ \exists h : |L_S (h) - L_{S'} (h) | \ge \frac{\epsilon}{2} \right\}.

By monotonicity of probability, we finish the proof.

□\square

Step 3
Pr⁡S,S′[∃h:∣LS(h)−LS′(h)∣≥ϵ2]≤max⁡S,S′∈ZnPr⁡σ[∃h:∣LσS(h)−LσS′(h)∣≥ϵ2] \Pr_{S, S' } \left[ \exists h : |L_S (h) - L_{S'} (h) | \ge \frac{\epsilon}{2} \right] \le \max_{S, S' \in \mathcal{Z}^n } \Pr_\sigma \left[ \exists h : |L_{ \sigma S} (h) - L_{ \sigma S' } (h) | \ge \frac{\epsilon}{2} \right]

Proof. We claim that σS\sigma S and σS′\sigma S' have the same joint distribution as SS and S′S' (if S,S′∼DnS, S' \sim \mathcal{D}^n). For points ∀Z,Z′∈Zn\forall Z, Z' \in \mathcal{Z}^n, by symmetry, it holds that

Pr⁡S,S′[S=Z,S′=Z′]=Pr⁡S,S′,σ[σS=Z,σS′=Z′] \Pr_{S, S'} [ S = Z, S' = Z'] = \Pr_{S, S', \sigma} [ \sigma S = Z, \sigma S' = Z']

The right hand side can be viewed as the successful probability of the following experiment:

  • Sample independently S∼DnS \sim \mathcal{D}^n and S′∼DnS' \sim \mathcal{D}^n.
  • For each i∈[n]i \in [n], exchange the ii-th elements of SS and S′S' independently with probability 0.50.5.
  • After the random swap, σS=Z\sigma S = Z and σS′=Z′\sigma S' = Z'.

Now, ∀E⊂Z2n\forall \mathcal{E} \subset \mathcal{Z}^{2n}, it holds that

Pr⁡S,S′[(S,S′)∈E]=Pr⁡S,S′,σ[(σS,σS′)∈E]=ES,S′[Pr⁡σ[(σS,σS′)∈E]∣S,S′]≤max⁡S,S′∈ZnPr⁡σ[(σS,σS′)∈E] \begin{aligned} \Pr_{S, S'} [ (S, S') \in \mathcal{E} ] &= \Pr_{S, S', \sigma} [ (\sigma S, \sigma S') \in \mathcal{E} ] \\ &= \mathbb{E}_{S, S'} [ \Pr_\sigma [(\sigma S, \sigma S') \in \mathcal{E} ] \mid S, S' ] \\ &\le \max_{S, S' \in \mathcal{Z}^n } \Pr_\sigma [(\sigma S, \sigma S') \in \mathcal{E} ] \end{aligned}

Replacing E\mathcal{E} with the set {Z,Z′∈Zn:∃h:∣LZ(h)−LZ′(h)∣≥ϵ2}\{Z, Z' \in \mathcal{Z}^n : \exists h : |L_Z (h) - L_{Z'} (h) | \ge \frac{\epsilon}{2} \} finishes the proof.

□\square

Proof of Lemma 2.

Let

S={(x1,y1),(x2,y2),...,(xn,yn)} S = \{ (x_1, y_1), (x_2, y_2), ..., (x_n, y_n) \}

and

S′={(x1′,y1′),(x2′,y2′),...,(xn′,yn′)}. S' = \{ (x_1', y_1'), (x_2', y_2'), ..., (x_n', y_n') \}.

be a pair of fixed sample sets. Define the set C={x1,x2,...,xn,x1′,x2′,...,xn′}⊂X\mathcal{C} = \{ x_1, x_2, ..., x_n, x_1', x_2', ..., x_n' \} \subset \mathcal{X} (with duplicates removed). The size of C\mathcal{C} is bounded by 2n2n and therefore the size of restriction of H\mathcal{H} on C\mathcal{C} is bounded by ΠH(2n)\Pi_\mathcal{H} (2n).

First, fix a hypothesis hh. For all i∈[n]i \in [n], define ai=∣ℓ(h(xi),yi)−ℓ(h(xi′),yi′)∣≤1a_i = |\ell( h( x_i ), y_i) - \ell( h( x_i' ), y_i' ) | \le 1 and let Vi∈{−1,1}V_i \in \{-1, 1\} be a random variable with equal probability:

Pr⁡[Vi=−1]=Pr⁡[Vi=1]=0.5 \Pr[ V_i = -1 ] = \Pr[ V_i = 1] = 0.5

If we apply a random swap σ\sigma to (S,S′)(S, S'), then LσS(hS)−LσS′(hS)L_{ \sigma S} (h_S) - L_{ \sigma S' } (h_S) has the same distribution as ∑i∈[n]1naiVi\sum_{i \in [n] } \frac{1}{n} a_i V_i. Since

E[∑i∈[n]1naiVi]=∑i∈[n]1naiE[Vi]=0, \mathbb{E} \left[ \sum_{i \in [n] } \frac{1}{n} a_i V_i \right] = \sum_{i \in [n] } \frac{1}{n} a_i \mathbb{E}[ V_i ] = 0,

by Hoeffding inequality,

Pr⁡σ[∣LσS(h)−LσS′(h)∣≥ϵ2]=Pr⁡[∣∑i∈[n]1naiVi−0∣≥ϵ2]≤2exp⁡(−2∑i∈[n]ai2(nϵ2)2)≤2exp⁡(−n2ϵ22) \begin{aligned} \Pr_\sigma \left[ |L_{ \sigma S} (h) - L_{ \sigma S' } (h) | \ge \frac{\epsilon}{2} \right] &= \Pr \left[ \left| \sum_{i \in [n] } \frac{1}{n} a_i V_i - 0 \right| \ge \frac{\epsilon}{2} \right] \\ &\le 2 \exp \left( - \frac{ 2 }{ \sum_{i \in [n] } a_i^2 } \left( \frac{n \epsilon}{2} \right)^2 \right) \\ &\le 2 \exp \left( - \frac{n^2 \epsilon^2 }{2} \right) \end{aligned}

The last inequality follows from that ∑i∈[n]ai2≤n\sum_{i \in [n] } a_i^2 \le n.

Since for each h∈Hh \in \mathcal{H}, it has the same behavior on C\mathcal{C} as some function in HC\mathcal{H}_\mathcal{C}. We can apply union bound on HC\mathcal{H}_\mathcal{C}.

Pr⁡σ[∃h:∣LσS(h)−LσS′(h)∣≥ϵ2]≤2∣HC∣exp⁡(−n2ϵ22)≤2ΠH(2n)exp⁡(−n2ϵ22) \Pr_\sigma \left[ \exists h : |L_{ \sigma S} (h) - L_{ \sigma S' } (h) | \ge \frac{\epsilon}{2} \right] \le 2 |\mathcal{H}_\mathcal{C} | \exp \left( - \frac{n^2 \epsilon^2 }{2} \right) \le 2 \Pi_\mathcal{H} (2n) \exp \left( - \frac{n^2 \epsilon^2 }{2} \right)

□\square

Reference

[1] Ethan Fetaya, "Lecture 02 - Introduction to Statistical Learning Theory", Weizmann Institute of Science, 2016

[2].R. Schapire and D. Bieber, “Lecture 05 - COS 511: Theoretical Machine Learning,”, Princeton University, 2013