CS307
Machine Learning
Lecture 9 Computational Learning Theory
Krishnendu Ghosh
Department of Computer Science & Engineering
Indian Institute of Information Technology Dharwad
Source: Chapter 7 from Tom Mitchell
INTRODUCTION
it is possible to set quantitative bounds on these measures, depending on attributes of the learning problem such as:
2
INTRODUCTION
Sample complexity. How many training examples are needed for a learner
to converge (with high probability) to a successful hypothesis?
Computational complexity. How much computational effort is needed for a
learner to converge (with high probability) to a successful hypothesis?
Mistake bound. How many training examples will the learner misclassify
before converging to a successful hypothesis?
3
PAC LEARNING
Problem Setting
X: The set of all possible instances over which target functions may be defined.
For example, X can be the set of all people, each described by the attributes age (e.g., young or old) and height (short or tall).
4
PAC LEARNING
Problem Setting
C: Some set of target concepts that our learner might be called upon to learn.
Each target concept c in C corresponds to some subset of X, or equivalently to some boolean-valued function c : X → {0, 1).
For example, one target concept c in C can be the concept "people who are skiers"
If x is a positive example of c, then we will write c(x) = 1
If x is a negative example, c(x) = 0.
5
PAC LEARNING
Problem Setting
We assume instances are generated at random from X according to some probability distribution Ɗ.
For example, Ɗ might be the distribution of instances generated by observing people who walk out of the largest sports store in Switzerland.
Training examples are generated by drawing an instance x at random according to Ɗ, then presenting x along with its target value, c(x), to the learner.
6
PAC LEARNING
Problem Setting
The learner L considers some set H of possible hypotheses when attempting
to learn the target concept.
For example, H might be the set of all hypotheses describable by conjunctions of the attributes age and height.
After observing a sequence of training examples of the target concept c, L must output some hypothesis h from H, which is its estimate of c. To be fair, we evaluate the success of L by the performance of h over new instances drawn randomly from X according to Ɗ, the same probability distribution used to generate the training data.
7
PAC LEARNING
Error of a Hypothesis
Definition: The true error (denoted errorƊ(h)) of hypothesis h with respect to target concept c and distribution Ɗ is the probability that h will misclassify an instance drawn at random according to Ɗ.
errorƊ(h) ≣ Px∈Ɗ [c(x) ≠ h(x)]
8
PAC LEARNING
Error of a Hypothesis
Note that error depends strongly on the unknown probability distribution Ɗ.
For example, if Ɗ is a uniform probability distribution that assigns the same probability to every instance in X, then the error for the hypothesis will be the fraction of the total instance space that falls into the region where h and c disagree.
However, the same h and c will have a much higher error if Ɗ happens to assign very high probability to instances for which h and c disagree.
9
PAC LEARNING
PAC Learnability
Our aim is to characterize the number of training examples needed to learn a hypothesis h for which errorƊ(h) = 0.
Unless we provide training examples corresponding to every possible instance in X, there may be multiple hypotheses consistent with the provided training examples, and the learner cannot be certain to pick the one corresponding to the target concept.
Given that the training examples are drawn randomly, there will always be some nonzero probability that the training examples encountered by the learner will be misleading.
10
PAC LEARNING
PAC Learnability
We will not require that the learner output a zero error hypothesis.
we will require only that its error be bounded by some constant ϵ that can be made arbitrarily small.
We will not require that the learner succeed for every sequence of randomly drawn training examples
we will require only that its probability of failure be bounded by some constant δ that can be made arbitrarily small.
We require only that the learner probably learn a hypothesis that is approximately correct, hence the term probably approximately correct learning, or PAC learning for short.
11
PAC LEARNING
PAC Learnability
Definition: Consider a concept class C defined over a set of instances X of length
n and a learner L using hypothesis space H. C is PAC-learnable by L using H
if for all c ∊ C, distributions Ɗ over X, ϵ such that 0 < ϵ < 1/2, and δ such that
0 < δ < 1/2, learner L will with probability at least (1 - ϵ) output a hypothesis
h ∊ H such that errorv(h) <= ϵ, in time that is polynomial in 1/ϵ, 1/δ, n, and
size(c).
12
PAC LEARNING
PAC Learnability
L must, with arbitrarily high probability (1 - δ), output a hypothesis having arbitrarily low error (δ).
It must do so efficiently - in time that grows at most polynomially with 1/ϵ and 1/δ,
which define the strength of our demands on the output hypothesis, and with n and size(c) that define the inherent complexity of the underlying instance space X and concept class C.
13
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Sample Complexity
A learner is consistent if it outputs hypotheses that perfectly fit the training data, whenever possible.
Can we derive a bound on the number of training examples required by any consistent learner, independent of the specific algorithm it uses to derive a consistent hypothesis?
14
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Sample Complexity
Version Space VSH,D is the set of all hypotheses h ∊ H that correctly classify the training examples D.
VSH,D = { h ∊ H | ( ∀ <x,c(x)> ∊ D) (h(x) = c(x) }
The significance of the version space is that every consistent learner outputs
a hypothesis belonging to the version space, regardless of the instance space X,
hypothesis space H, or training data D.
15
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Sample Complexity
The reason is simply that by definition the version space VSH,D contains every consistent hypothesis in H.
Therefore, to bound the number of examples needed by any consistent learner, we need only bound the number of examples needed to assure that the version space contains no unacceptable hypotheses.
16
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Definition: Consider a hypothesis space H, target concept c, instance distribution
Ɗ, and set of training examples D of c. The version space VSH,D is said to be
ϵ-exhausted with respect to c and Ɗ, if every hypothesis h in VSH,D has error less than ϵ with respect to c and Ɗ.
(∀ h ∊ VSH,D) = errorƊ(h) < ϵ
zero training error (r = 0)
17
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Theorem. ϵ-exhausting the version space. If the hypothesis space H is finite,
and D is a sequence of m >= 1 independent randomly drawn examples of some target concept c, then for any 0 <= ϵ <= 1, the probability that the version space VSH,D is not ϵ-exhausted (with respect to c) is less than or equal to |H|e-ϵm
m >= 1/ϵ ( ln |H| + ln(1/δ) )
18
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Proof.
Let h1, h2, ... hk be all the hypotheses in H that have true error greater than ϵ with respect to c.
We fail to ϵ-exhaust the version space iff at least one of these k hypotheses happens to be consistent with all m independent random training examples.
The probability that any single hypothesis having true error greater than ϵ would be consistent with one randomly drawn example is at most (1 - ϵ). Therefore the probability that this hypothesis will be consistent with rn independently drawn examples is at most (1 - ϵ)m
Given that we have k hypotheses with error greater than ϵ, the probability that at least one of these will be consistent with all m training examples is at most k(1 - ϵ)m
19
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Proof.
Since k <= |H|, this is at most |H|(1 - ϵ)m.
Finally, we use a general inequality stating that if 0 <= ϵ <= 1 then (1 - ϵ) < e-ϵ
So, k(1 - ϵ)m <= |H|(1 - ϵ)m <= |H|e-ϵm
Let us use this result to determine the number of training examples required to reduce this probability of failure below some desired level δ.
|H|e-ϵm < δ
Rearranging terms to solve for m, we find m >= 1/ϵ ( ln |H| + ln(1/δ) )
20
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
m >= 1/ϵ ( ln |H| + ln(1/δ) )
Note. m grows linearly in 1/ϵ and logarithmically in 1/δ. It also grows logarithmically in the size of the hypothesis space H .
21
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
If H does not contain the target concept c, then a zero-error hypothesis cannot always be found. In this case, the most we might ask of our learner is to output the hypothesis from H that has the minimum error over the training examples.
A learner that makes no assumption that the target concept is representable by H and that simply finds the hypothesis with minimum training error, is often called an agnostic learner, because it makes no prior commitment about whether C ⊆ H
22
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
D denotes the particular set of training examples available to the learner, in contrast to Ɗ, which denotes the probability distribution over the entire set of instances.
Let errorD(h) denote the training error of hypothesis h.
In particular, errorD(h) is defined as the fraction of the training examples in D that are misclassified by h
Note the errorD(h) over the particular sample of training data D may differ from the true error errorƊ(h) over the entire probability distribution Ɗ.
23
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
let hbest denote the hypothesis from H having lowest training error over the training examples.
How many training examples suffice to ensure (with high probability) that its true error errorƊ(hbest) will be no more than ϵ + errorD(hbest)?
Notice the question considered in the previous section is just a special case of this question, when errorD(hbest) happens to be zero.
24
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
Hoeffding bounds (additive Chernoff bounds) to characterize the deviation between the true probability of some event and its observed frequency over m independent trials.
The Hoeffding bounds state that if the training error errorD(h) is measured over the set D containing m randomly drawn examples, then
P[errorƊ(h) > errorD(h) + ϵ] <= e-2mϵ^2
25
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
This gives us a bound on the probability that an arbitrarily chosen single hypothesis
has a very misleading training error. To assure that the best hypothesis found by
L has an error bounded in this way, we must consider the probability that any
one of the |H| hypotheses could have a large error
P[ Ǝh ∈ H errorƊ(h) > errorD(h) + ϵ] <= e-2mϵ^2
26
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
If we call this probability δ, and ask how many examples m suffice to hold δ to
some desired value, we now obtain
m >= 1/2ϵ2 ( ln|H| + ln(1/δ) )
This is the generalization to the case in which the learner still picks the best hypothesis h∈H, but where the best hypothesis may have nonzero training error.
27
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Agnostic Learning and Inconsistent Hypotheses
Notice that m depends logarithmically on H and on 1/δ, as it did in the more restrictive case. However, in this less restrictive situation m now grows as the square of 1/ϵ, rather than linearly with 1/ϵ.
28
SAMPLE COMPLEXITY FOR FINITE HYPOTHESIS SPACES
Theorem 7.2. PAC-learnability of boolean conjunctions.
The class C of conjunctions of boolean literals is PAC-learnable by the FIND-S algorithm using H = C .
29
SAMPLE COMPLEXITY FOR INFINITE HYPOTHESIS SPACES
Shattering a Set of Instances
Definition: A set of instances S is shattered by hypothesis space H if and only if
for every dichotomy of S there exists some hypothesis in H consistent with this
dichotomy.
30
SAMPLE COMPLEXITY FOR INFINITE HYPOTHESIS SPACES
The Vapnik-Chervonenkis Dimension
Definition: The Vapnik-Chervonenkis dimension, VC(H), of hypothesis space H
defined over instance space X is the size of the largest finite subset of X shattered
by H . If arbitrarily large finite sets of X can be shattered by H, then VC(H) = ∞.
31
THE MISTAKE BOUND MODEL OF LEARNING
Mistake Bound for the FIND-S Algorithm
To illustrate, consider again the hypothesis space H consisting of conjunctions of up to n boolean literals l1 . . .ln, and their negations (e.g., Rich ∧ ¬Handsome).
Recall the FIND-S algorithm, which incrementally computes the maximally specific hypothesis consistent with the training examples. A straightforward implementation of FIND-S for the hypothesis space H is as follows:
32
THE MISTAKE BOUND MODEL OF LEARNING
Mistake Bound for the FIND-S Algorithm
FIND-S:
Initialize h to the most specific hypothesis l1 ∧ ¬l1 ∧ l2 ∧ ¬l2 … ln ∧ ¬ln
For each positive training instance x
Remove from h any literal that is not satisfied by x
Output hypothesis h
33
THE MISTAKE BOUND MODEL OF LEARNING
Optimal Mistake Bounds
34
THE MISTAKE BOUND MODEL OF LEARNING
Optimal Mistake Bounds
Definition: Let C be an arbitrary nonempty concept class. The optimal mistake bound for C, denoted Opt(C), is the minimum over all possible learning algorithms A of MA(C).
Opt(C) = minA ∈ learning algorithms MA(C)
Opt(C) is the number of mistakes made for the hardest target concept in C
35
THE MISTAKE BOUND MODEL OF LEARNING
Optimal Mistake Bounds
Littlestone (1987) shows that for any concept class C, there is an interesting relationship among the optimal mistake bound for C, the bound of the HALVING
algorithm, and the VC dimension of C, namely
VC(C) <= Opt(C) <= MHalving(C) <= log2(|C|)
36
THE MISTAKE BOUND MODEL OF LEARNING
Optimal Mistake Bounds
Furthermore, there exist concept classes for which the four quantities above
are exactly equal. One such concept class is the powerset Cp of any finite set
of instances X. In this case, VC(Cp) = |X| = log2(|Cp|), so all four quantities
must be equal.
Littlestone (1987) provides examples of other concept classes for which VC(C) is strictly less than Opt(C) and for which Opt(C) is strictly less than MHalving(C)
37
Thank You
38