CSE 694: Probabilistic Analysis and Randomized Algorithms Lecturer: Hung Q. Ngo

advertisement
CSE 694: Probabilistic Analysis and Randomized Algorithms
SUNY at Buffalo, Fall 2011
Lecturer: Hung Q. Ngo
Last update: October 25, 2011
Inconsistent Hypothesis Model and the Uniform Convergence Theorem
1
Inconsistent Hypothesis Model
There are obvious drawbacks with the PAC-learning model:
• There may not be any target concept c ∈ C which “generates” the labels for the samples.
• Due to noise, they may not be any function consistent with the samples. For example, we might get
both (x, 1) and (x, 0) in the samples, due to noise. Perhaps out of 1000 (x1 , 1) there is one (x, 0) due
to noise.
• Finding a consistent hypothesis might be an NP-hard problem, which is quite often the case.
We want to extend PAC to deal with these drawbacks, especially to deal with noises which are very real
in practice. The new learning model is called the inconsistent hypothesis model (IHM), which is realistic.
We will stick with this model for the rest of the semester. IHM has the following assumptions:
• There is some unknown distribution D on Ω × {0, 1} from which the m samples
S = {(x1 , y1 ), (x2 , y2 ), · · · , (xm , ym )}
are drawn. Here xi ∈ Ω and yi ∈ {0, 1} is a label for xi . Note that a particular x might appear many
times in S with different labels.
• There is a hypothesis class H from which the learner L needs to pick a hypothesis hS . Each hypothesis
is a function from Ω to {0, 1}.
• The “quality” of a hypothesis h is measured by its generalization error
errD (h) := Prob [h(x) 6= y]
(x,y)∼D
We will often drop the subscript and write err(h). Note that there is no longer a target concept!
The generalization error is also called the risk of h. (This definition of risk comes from something
called 01-loss function. In more general settings, the risk can be measured with other types of ”loss
functions,” which we will come to later once we have time.)
Definition 1.1 (Ideal problem). Find a hypothesis h∗ which minimizes the generalization error:
h∗ = argmin{err(h)}.
h∈H
1
Suppose we do know D, then the following hypothesis is obviously the optimal hypothesis:
(
1 Prob[y = 1 | x] ≥ 1/2
hOPT (x) =
0 Prob[y = 1 | x] < 1/2
The function hOPT is called the Bayes optimal classifier, and its risk err(hOPT ) is called the Bayes risk.
We cannot solve the ideal problem because we do not know D. In particlar, we cannot evaluate err(h).
A common trick for optimizing over some un-evaluatable function is to find another function which approximates the unknown function, and optimize on the approximation function instead. The natural approximation for err(h) is the empirical error (also called empirical risk or empirical loss):
m
1 X
ec
rrS (h) =
1h(xi )6=yi = E [1h(x)6=y ].
m
(x,y)∼S
i=1
Here, the expectation Ex∼S [·] is on the uniform distribution on the m samples S. The expected value of
the empirical error of any function is the function’s generalization error. (We will make it precise below.)
Hence, with enough samples we expect that the empirical error approximates the generalization error very
well. We will prove a theorem to that effect. We can thus change the problem. The following is actually
more like a “strategy” rather than a problem.
Definition 1.2 (Empirical Risk Minimization (ERM)). Find a hypothesis ĥ∗ ∈ H which minimizes the
empirical error:
ĥ∗ = argmin {c
errS (h)} .
h∈H
The following relationship is obvious from definition:
err(ĥ∗ ) ≥ err(h∗ ) ≥ err(hOPT ).
Exercise 1. When does err(h∗ ) = err(hOPT )?
Now, the quality of our solution to the ERM problem can be broken up into two parts:
err(ĥ∗ ) − err(hOPT ) = [err(ĥ∗ ) − err(h∗ )] + [err(h∗ ) − err(hOPT )] .
|
{z
} |
{z
}
Estimation error
Approximation error
The estimation error measures the quality of the samples S. The approximation error measures the
quality of the hypothesis class H. We can reduce the approximation error by picking a better hypothesis
class H. It would be zero if hOPT ∈ H, for example. Estimating the approximation error is usually hard
when we do not make any assumption about the target distribution. In fact, under certain assumptions it can
be shown that the rate of convergence to zero of the approximation error can be arbitrarily slow.
We will focus on bounding the estimation error, which is accomplished by showing the so-called uniform
convergence theorems (UCT). To get a sense of how the reasoning goes, we will prove a finite version of the
UCT first, and the VC-dimension analog next.
2
2
Uniform convergence, finite H case
Theorem 2.1. Suppose H is finite, if we take m i.i.d. samples with
log 2|H|
δ
m≥
2
2
then
rr(h)| ≤ ≥ 1 − δ.
Probm sup |err(h) − ec
S∼D
h∈H
In other words, by taking m i.i.d. samples we have

v

u
u log 2|H|


t
δ
 ≥ 1 − δ.
Probm 
sup |err(h) − ec
rrS (h)| ≤


S∼D
2m
h∈H
Proof. Note that the expected empirical error (over the random samples S) is exactly the generalization
error. Specifically,
"
#
m
1 X
E [c
errS (h)] =
E
1h(xi )6=yi
S∼Dm
S∼Dm m
i=1
=
m
1 X
E [h(xi ) 6= yi )]
S∼Dm
m
=
m
1 X
E [h(xi ) 6= yi )]
m
(xi ,yi )∼D
=
m
1 X
Prob [h(xi ) 6= yi )]
m
(xi ,yi )∼D
=
m
1 X
err(h)
m
i=1
i=1
i=1
i=1
= err(h).
Hence, by Hoeffding inequality we have, for any hypothesis h ∈ H, the difference between the empirical
error and the generalization error is large with exponentially small probability:
Probm [|err(h) − ec
rrS (h)| > ] ≤ 2e−2
S∼D
2m
.
The union bound gives
Prob
S∼Dm
2
sup |err(h) − ec
rrS (h)| > ≤ 2|H|e−2 m ,
h∈H
which yields the desired result.
3
(1)
Exercise 2. We can show that the empirical error is close to the generalization error (when m large) with
high probability without resorting to Hoeffding inequality. Let h be an arbitrary hypothesis. Let (xi , yi ) ∼ D
be m independent examples taken from D.
(a) Prove that Var 1h(xi )6=yi ≤ 1/4 for every i ∈ [m].
(b) Using Chebyshev’s inequality, prove that
Prob [|c
errS (h) − err(h)| > ] ≤
S∼Dm
1
.
4m2
(Of course, this bound is not as good as the Hoeffding bound asymptotically, but it is good enough in some
cases.)
This theorem quantifies our intuition that the empirical error is a good approximation to the generalization error if there are enough samples. We can bound the estimation error as follows. With probability at
least 1 − 2δ,
err(ĥ∗ ) − err(h∗ ) = [err(ĥ∗ ) − ec
rr(ĥ∗ )] + [c
err(ĥ∗ ) − err(h∗ )]
≤ + [c
err(ĥ∗ ) − err(h∗ )]
≤ + [c
err(h∗ ) − err(h∗ )]
≤ 2
v
u
u log 2|H|
t
δ
= 2
.
2m
The first inequality comes from the uniform convergence theorem. The second inequality is the fact that ĥ∗
has the minimum empirical error among all functions in H, including h∗ . The third inequality is again the
uniform convergence theorem.
A few observations are worth noticing:
• Increasing m leads to reduced estimation error. This is intuitively obvious
• The sample size is dependent on 2 instead of as in the corresponding PAC learning theorem.
• We can also try to reduce the complexity |H| of the hypothesis class in order to reduce the estimation
error. However, reducing H will likely increase the approximation error!
• To reduce the approximation error (in effect, reducing err(h∗ )) we must increase ther”power” of the
log
“
2|H|
δ
”
hypothesis class H, which implies increasing |H|. However, eventually the term
will
2m
∗
dominate the err(h ) term and we get to a nasty situation called overfitting. This is a fundamental
(and difficult) problem of Machine Learning. Structural Risk Minimization and Regularization are
two strategies (among others) for dealing with overfitting. We will also discuss AdaBoost and SVM
which are algorithms which can cope relatively well with overfitting.
4
3
Uniform convergence, infinite H case
Theorem 3.1. For any δ > 0, if we take m i.i.d. samples then
#
"
r
ln |ΠH (2m)| + ln(4/δ)
≤ δ.
Prob sup |c
errS (h) − err(h)| > 2 2
S
m
h∈H
More concretely, if d = VCD(H) then from Sauer lemma we can infer
"
#
r
d ln(2me/d) + ln(4/δ)
Prob sup |c
errS (h) − err(h)| > 2 2
≤ δ.
S
m
h∈H
It is possible to knock off the ln m factor inside the square root, but that’s beyond the scope of this document.
Proof. The proof has three steps, of which the first step is the most important. We have kind of seen all
three steps in the proof to the Vapnik-Chevonenkis theorem for PAC learning.
Step 1: Symmetrization. This is the step that brings the infinite down to the finite, using the double
sampling trick which we have seen before. Let S = {(x1 , y1 ), · · · , (xm , ym )} be the first m i.i.d. samples
0 )} be the second set of m i.i.d. (ghost) samples. We will prove that, for
and S 0 = {(x01 , y10 ), · · · , (x0m , ym
2
any > 0 where m ≥ 2,
Prob sup |c
errS (h) − err(h)| > ≤ 2 · Prob0 sup |c
errS (h) − ec
rrS 0 (h)| > /2 .
(2)
S
S,S
h∈H
h∈H
For a given sample set S, define hS as follows. If suph∈H |c
errS (h) − err(h)| > then let hS be any
hypothesis such that |c
errS (hS ) − err(hS )| > . If suph∈H |c
errS (h) − err(h)| ≤ then let hS be an arbitrary
hypothesis. From the definition of hS , it follows that
sup |c
errS (h) − err(h)| > implies {|c
errS (hS ) − err(hS )| > }
h∈H
and thus
Prob sup |c
errS (h) − err(h)| > ≤ Prob [|c
errS (hS ) − err(hS )| > ] .
S
S
h∈H
Conditioned on S, from the triangle inequality we conclude that
{|c
errS (hS ) − err(hS )| > and |c
errS 0 (hS ) − err(hS )| ≤ /2} implies {|c
errS (hS ) − ec
rrS 0 (hS )| > /2.}
Thus,
1|c
errS (hS )−err(hS )|> 1|c
errS 0 (hS )−err(hS )|≤/2 ≤ 1|c
errS (hS )−c
errS 0 (hS )|>/2 .
(3)
Now, still conditioned on S, take expectation over S 0 on both sides of the above we obtain
1|c
[|c
errS 0 (hS ) − err(hS )| ≤ /2] ≤ Prob
[|c
errS (hS ) − ec
rrS 0 (hS )| > /2] .
errS (hS )−err(hS )|> Prob
0
0
S
S
(4)
Now, let’s look at the probability ProbS 0 [|c
errS 0 (hS ) − err(hS )| ≤ /2] on the left of (4). (Again, conditioning on S is implicit.) From Exercise 2, we have
Prob
[|c
errS 0 (hS ) − err(hS )| < /2] ≤
0
S
5
1
4(/2)2 m
which is at most 1/2 if 2 m ≥ 2. Consequently, when 2 m ≥ 2 we have
1
Prob
[|c
errS 0 (hS ) − err(hS )| ≥ /2] ≥ .
2
S0
(5)
1|c
[|c
errS (hS ) − ec
rrS 0 (hS )| > /2] .
errS (hS )−err(hS )|> ≤ 2 · Prob
0
(6)
Now, (4) implies
S
Finally, take expectation over S on both side of (6) we obtain (2). (Why?)
Step 2: Symmetrization using Rademacher variables. Let σi ∈ {−1, 1}, i ∈ [m], be m independent
Rademacher random variables, namely Prob[σi = 1] = Prob[σi = −1] = 1/2. We have
errS (h) − ec
rrS 0 (h)| > /2
Prob0 sup |c
S,S
h∈H
m
"
#
1 X
= Prob0 sup (1{h(xi )6=yi } − 1{h(x0i )6=yi0 } ) > /2
S,S
h∈H m i=1
#
"
m
1 X σi 1{h(xi )6=yi } − 1{h(x0i )6=yi0 } > /2
= Prob
sup S,S 0 ,σ h∈H m i=1
"
##
"
m
1 X 0
= ES,S 0 Prob sup σi 1{h(xi )6=yi } − 1{h(x0i )6=yi0 } > /2 | S, S
σ
h∈H m i=1
"
"
##
m
1 X = ES,S 0 Prob
sup
σi 1{h(xi )6=yi } − 1{h(x0i )6=yi0 } > /2 | S, S 0
σ
h∈ΠH (S∪S 0 ) m i=1
The second equality “says” that independently swapping the ith sample from S and the ith sample from S 0
does not change the overall probability. The third equality comes from marginalizing over σ.
Step 2’: Concentration bounding using Hoeffding inequality. Now, fix S, S 0 , and look at the probability inside the expectation. Note that for a fixed h ∈ ΠH (S ∪ S 0 ) the expressions
Zi = σi 1{h(xi )6=yi } − 1{h(x0i )6=yi0 }
are independent random variables in [−1, 1] with zero expectation. Hence, Hoeffding inequality implies
" m
#
1 X 2
Prob
Zi > /2 < 2e−m /8 .
σ
m
i=1
(Here, we use the Hoeffing bound from Exercise 7 of the Tail Inequality lecture.)
Step 3: Union bound. The above inequality holds for a fixed h (and fixed S, S 0 ). Thus, applying the
union bound on ΠH (S ∪ S 0 ) we obtain
#
"
m
1 X 2
0
σi 1{h(xi )6=yi } − 1{h(x0i )6=yi0 } > /2 | S, S ≤ 2|ΠH (2m)|e−m /8 .
Prob sup σ
h∈H m i=1
This means the expectation (over S, S 0 ) of the LHS is at most the RHS also. Putting everything together, we
conclude that
Prob sup |c
errS (h) − err(h)| > ≤ 4|ΠH (2m)|e−m
S
h∈H
Setting the last expression ≤ δ and we are done.
6
2 /8
.
Download