Docsity

Computational Learning Theory - Notes | CMPSCI 689, Exams of Computer Science

Partial preview of the text

Download Computational Learning Theory - Notes | CMPSCI 689 and more Exams Computer Science in PDF only on Docsity!

Computational Learning

Theory

Sridhar Mahadevan [email protected] University of Massachusetts

©

Sridhar Mahadevan: CMPSCI 689 – p.1/

Topics

Computational learning theory PAC Learning Model Sample complexity: finite case Time complexity: finite case VC dimension: infinite hypothesis spaces

©

Sridhar Mahadevan: CMPSCI 689 – p.2/

Training vs. TestDistribution

Example:

Consider an environmental-cleanup robot that needs to inspect trees for

damage from acid rain. We need to train this robot to recognize “trees”. Suppose we train our robot in Amherst. What will its performance in Florida be?Vice-versa, we train our robot in Florida. How will it do in Amherst? Result:

Robot trained in Florida will get confused by “fall colors”. Vice-versa, robot

trained in Amherst will not recognize palm trees. For any given instance space, there is a

non-uniform

likelihood of seeing different

instances. We can represent this situation by imagining that there is a

probability

distribution

on the space of instances.

The learner does not know this distribution ahead of time, but is allowed to assumethat it is

fixed

. Thus, a learner trained on one particular distribution should only be

tested on that distribution.

©

Sridhar Mahadevan: CMPSCI 689 – p.4/

ApproximateConcept Learning

Requiring a learner to learn the

right

concept is too strict (e.g. is there a “right”

concept of

tree

Instead, we relax this requirement and allow a learner to produce a

good

approximation

to the actual concept.

Let

P

(x

)^ be a fixed probability distribution on the instance space. Let

c^

be the

target concept, and let

h

be the concept produced by the learner.

Let

S

x|

c(

x)

h

(x

be the set of instances on which the target concept and

the approximation disagree. Let

^

be an error tolerance parameter where

. Then

h

is a good approximation (to within

) of

c^

if and only if:

∑ x∈

S

P^

(x

)^ ≤

©

Sridhar Mahadevan: CMPSCI 689 – p.5/

Version Spaces

Define the

version space

as the set of all hypothesis

h

H

consistent with the

target concept. We say a version space is

exhausted

if there is a only a single hypothesis

h

consistent with the target concept. This is often intractable because it requires thelearner to learn the exact concept. Given a hypothesis space

H

, a target concept

c, a sequence of examples

D

of

c,

and an error tolerance

, the version space of

D

(w.r.t.

H

) is

-exhausted if it does

not contain any hypothesis that has (

true

) error more than

^

(w.r.t

c).

We will only require that the learner produce an

-exhausted version space.

Question:

How many examples are needed to

-exhaust a version space?

©

Sridhar Mahadevan: CMPSCI 689 – p.7/

ProbabilisticLearning

Assume training examples are drawn

independently and randomly

from an unknown

but fixed distribution

P

on the instance space.

We only require that the learner succeed in producing a good approximation to thetarget concept

with high probability

Specifically, given a confidence parameter

δ , we require the learner to be able to

-exhaust a version space with probability at least

δ

So how many examples are needed for the learner to

-exhaust a version space

with probability

δ

©

Sridhar Mahadevan: CMPSCI 689 – p.8/

Sample Complexity

Corollary:

Given reliability

δ^

and error

, the number of examples needed to

-exhaust a version space consistent with some

c^

in

H

is

m

(ln

(^1) ( δ

ln

(|H

Proof:

We know from the theorem that

δ^

H

|e −m

Taking natural logarithms on either side, we get

ln

(δ

)^ ≥

ln

(|H

|)^

m

Transforming the above, we get

m

(ln

(^1) ( δ

ln

(|H

©

Sridhar Mahadevan: CMPSCI 689 – p.10/

Example

Let the hypothesis space

H

be all pure conjunctive formulae over

n

boolean

attributes

A

,... , A 1

.n

|H

|^ = 3

n. m

1 (^ ^

ln

(^1) ( δ

ln

n))

m

1 (^ ^

ln

(^1) ( δ

nln

Number of examples is linear in

n

Consider

n

,^ 

.^05

,^ δ

.^05

, then

m

10.^05

(ln

(^

10.^05

ln

This is quite good, considering that there are almost

,^000

pure conjunctive

concepts on

boolean variables.

©

Sridhar Mahadevan: CMPSCI 689 – p.11/

Generic PACLearning Algorithm

PAC-Learn-H

(, δ

Call the EXAMPLE routine

m

times, where m

1 (^ ^

ln

(^1) ( δ

ln

(|H

Collect the examples in a set

S

Output any

g^

∈^

H

consistent with

S

Note sample complexity theorem guarantees

g output by algorithm will be PAC.

How do we find a consistent hypothesis?

How do we know if

ln

(|H

|)^

is polynomial in

n

Can we do better than

ln

(|H

What if

H

is infinite?

©

Sridhar Mahadevan: CMPSCI 689 – p.13/

Learning Monomials

Let

F

be the set of all pure conjunctive formulae (monomials) over attributes A

,... , A 1

. (e.g.n

is

large

is

mammal

has

claws

can

fly

Algorithm Learn

pure

conj

(, δ, n

Let

m

1  (n

(ln

ln

(^1) ( δ

Call EXAMPLE

m

times and collect examples in set

S

Initialize

h

A

A

... A 1

n^

A

n

For each positive example

e^

∈^

S^

do

if^ ei

remove

A

fromi

h

else remove

A

.i

Output

h

NOTE:

Since algorithm

A

takes only polynomially many examples, and also runs in

polynomial time (in

1 

,^

1 , n δ^

),^

F^

is^

polynomial-time PAC learnable

. ©Sridhar Mahadevan: CMPSCI 689 – p.14/

PAC Results forConcept Classes

Class

Sample complexity

PAC-time learnable?

Pure conj.

Polynomial

Polynomial

k-CNF

Polynomial

Polynomial

k-term DNF

Polynomial

No, unless NP

RP

Interesting fact: k-term DNF

k-CNF. So, learning a larger set can be easier than learning

a smaller set!

©

Sridhar Mahadevan: CMPSCI 689 – p.16/

Infinite Hypotheses:Shattering

Let

I^

be an instance space, and let

H

be some (possibly infinite) space of

concepts on

I

. Let

S

be some set of instances from

I

A^

dichotomy

of

S

is a partition of

S

into two disjoint subsets

S

p^

and

S

.n

We say

H

shatters

S

if there exists a hypothesis

h

H

that is consistent with every

possible dichotomy of

S

Example 1: Let

I^

be the set of real numbers, and

H

be the set of all possible

intervals

(a, b

)^ on

I

. Let

S

be any two real numbers, for example

S^

,^ −

.^5

}. Then,

H

shatters

S

Example 2: Let

H

be defined by the tree-structured attribute

shape

. Let

I

be

leaves of the

shape

tree. Let

S

be any two instances, say

triangle, circle

}. Then

S^

is shattered by

H

©

Sridhar Mahadevan: CMPSCI 689 – p.17/

Vapnik-Chervonenkis(VC) Dimension

The

V C

dimension of a concept space

H

is the size of the largest set of instances

shattered by

H

. (Note that it can be infinite).

Example 1: the

V C

dimension is =

Example 2: the

V C

dimension is =

Observation:

Let

d

be the

V C

dimension of a space

H

. Then,

d 2

H

d^

log

|H

©

Sridhar Mahadevan: CMPSCI 689 – p.19/

VC Dimension

How many examples does it take to PAC learn any concept

c^

∈^

H

, with error

^

and

confidence

δ

Theorem

(Blumer et al.)

m

(^4

log

2 ) + 8 δ^

V C

(H

)log

13 ^

Note that since

V C

(H

)^ ≤

log

|H

|), this is a more tight bound. Also, it applies even for

infinite hypothesis spaces (e.g. all rectangles on the plane). Example:

How many examples does it take to PAC learn a rectangle on the x-y plane,

with confidence 90% and accuracy 95%? Solution:

We need

m

examples, where m^

1.^1

log

×

4 log

13.^1

log

log

.^48 ©Sridhar Mahadevan: CMPSCI 689 – p.20/