25
c Stanley Chan 2020. All Rights Reserved. ECE595 / STAT598: Machine Learning I Lecture 26 Growth Function Spring 2020 Stanley Chan School of Electrical and Computer Engineering Purdue University 1 / 25

ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

ECE595 / STAT598: Machine Learning ILecture 26 Growth Function

Spring 2020

Stanley Chan

School of Electrical and Computer EngineeringPurdue University

1 / 25

Page 2: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Outline

Lecture 25 Generalization

Lecture 26 Growth Function

Lecture 27 VC Dimension

Today’s Lecture:

Overcoming the M Factor

Decisions based on Training SamplesDichotomy

Examples of mH(N)

Finite 2D SetPositive rayIntervalConvex set

2 / 25

Page 3: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Probably Approximately Correct

Probably: Quantify error using probability:

P[|Ein(h)− Eout(h)| ≤ ε

]≥ 1− δ

Approximately Correct: In-sample error is an approximation of the out-sample error:

P [|Ein(h)− Eout(h)| ≤ ε] ≥ 1− δ

If you can find an algorithm A such that for any ε and δ, there exists an N which canmake the above inequality holds, then we say that the target function is PAC-learnable.

3 / 25

Page 4: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

The Factor “M”

Testing

P{|Ein(h)− Eout(h)| > ε

}≤ 2e−2ε

2N ,

Training

P{|Ein(g)− Eout(g)| > ε

}≤ 2Me−2ε

2N .

So what? M is a constant.

Bad news: M can be large, or even ∞.

A linear regression has M =∞.

Good news: It is possible to bound M.

We will do it later.

4 / 25

Page 5: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Overcoming the M Factor

The Bad events Bm are

Bm = {|Ein(hm)− Eout(hm)| > ε}

The factor M is here because of the Union bound:

P[B1 or . . . or BM ] ≤ P[B1] + . . .+ P[BM ].

5 / 25

Page 6: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Counting the Overlapping Area

∆Eout = change in the +1 and -1 areaExample below: Change a little bit∆Ein = change in labels of the training samplesExample below: Change a little bit, tooSo we should expect the probabilities

P[|Ein(h1)− Eout(h1)| > ε] ≈ P[|Ein(h2)− Eout(h2)| > ε].

6 / 25

Page 7: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Looking at the Training Samples Only

Here is a our goal: Find something to replace M.But M is big because the whole input space is big.Let us look at the input space.

7 / 25

Page 8: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Looking at the Training Samples Only

If you move the hypothesis a little, you get a different partition

Literally there are infinitely many hypotheses

This is M

8 / 25

Page 9: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Looking at the Training Samples Only

Here is a our goal: Find something to replace MBut M is big because the whole input space is bigCan we restrict ourselves to just the training sets?

9 / 25

Page 10: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Looking at the Training Samples Only

The idea is: Just look at the training samplesPut a mask on your datasetDon’t care until a training sample flips its sign

10 / 25

Page 11: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Dichotomies

We need a new name: dichotomy.Dichotomy = mini-hypothesis.

Hypothesis Dichotomy

h : X → {+1,−1} h : {x1, . . . , xN} → {+1,−1}for all population samples for training samples only

number can be infinite number is at most 2N

Different hypothesis, same dichotomy.

11 / 25

Page 12: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Dichotomy

Definition

Let x1, . . . , xN ∈ X . The dichotomies generated by H on these points are

H(x1, . . . , xN) = {(h(x1), . . . , h(xN)) | h ∈ H} .

12 / 25

Page 13: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Dichotomy

Definition

Let x1, . . . , xN ∈ X . The dichotomies generated by H on these points are

H(x1, . . . , xN) = {(h(x1), . . . , h(xN)) | h ∈ H} .

13 / 25

Page 14: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Candidate to Replace M

So here is our candidate replacement for M.

Define Growth Function

mH(N) = maxx1,...,xN∈X

|H(x1, . . . , xN)|

You give me a hypothesis set HYou tell me there are N training samples

My job: Do whatever I can, by allocating x1, . . . , xN , so that the number of dichotomiesis maximized

Maximum number of dichotomy = the best I can do with your HmH(N): How expressive your hypothesis set H is

Large mH(N) = more expressive H = more complicated HmH(N) only depends on H and N

Doesn’t depend on the learning algorithm ADoesn’t depend on the distribution p(x) (because I’m giving you the max.)

14 / 25

Page 15: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Outline

Lecture 25 Generalization

Lecture 26 Growth Function

Lecture 27 VC Dimension

Today’s Lecture:

Overcoming the M Factor

Decisions based on Training SamplesDichotomy

Examples of mH(N)

Finite 2D SetPositive rayIntervalConvex set

15 / 25

Page 16: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Examples of mH(N)

H = linear models in 2D

N = 3

How many dichotomies can I generate by moving the three points?

This gives you 8. Are we the best?

16 / 25

Page 17: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Examples of mH(N)

H = linear models in 2D

N = 3

How many dichotomies can I generate by moving the three points?

This gives you 6. The previous is the best. So mH(3) = 8.

17 / 25

Page 18: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

What about mH(4)? Ans: 14.

18 / 25

Page 19: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Another Example

H = set of h: R→ {+1,−1}h(x) = sign(x − a)

Cut the line into two halves

You can only move along the line

mH(N) = N + 1

The N comes from the N points

The +1 comes from the two ends19 / 25

Page 20: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Another Example

H = set of h: R→ {+1,−1}Put an interval

Length of the interval is N points

mH(N) =

(N + 1

2

)+ 1 =

N2

2+

N

2+ 1

Think of N + 1 balls, pick 2.

20 / 25

Page 21: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Another Example

H = set of h: R2 → {+1,−1}h(x) = +1 is convex

Here are some examples

21 / 25

Page 22: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Another Example

How about this collection of data points?

Can you find an h such that you get a convex set?

Yes. Do convex hull.

Does it give you the maximum number of dichotomies?

No. All interior points do not contribute.

22 / 25

Page 23: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Another Example

The best you can do is this.

Put all the points on a circle.

Then you can get at most 2N different dichotomies

SomH(N) = 2N

That is the best you can ever get with N points23 / 25

Page 24: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Summary of the Examples

H is positive ray:mH(N) = N + 1

H is positive interval:

mH(N) =

(N + 1

2

)+ 1 =

N2

2+

N

2+ 1

H is convex set:mH(N) = 2N

So if we can replace M by mH(N)

And if mH(N) is a polynomial

Then we are good.

24 / 25

Page 25: ECE595 / STAT598: Machine Learning I Lecture 26 Growth ...€¦ · Outline Lecture 25 Generalization Lecture 26 Growth Function Lecture 27 VC Dimension Today’s Lecture: Overcoming

c©Stanley Chan 2020. All Rights Reserved.

Reading List

Yasar Abu-Mostafa, Learning from Data, chapter 2.1

Mehrya Mohri, Foundations of Machine Learning, Chapter 3.2

Stanford Note http://cs229.stanford.edu/notes/cs229-notes4.pdf

25 / 25