chapter 4 (part 1): non-parametric classification (sections 4.1-4.3)

24
Pattern Pattern Classification Classification All materials in these slides All materials in these slides were taken from were taken from Pattern Classification (2nd ed) by R. O. Duda, Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley & Sons, P. E. Hart and D. G. Stork, John Wiley & Sons, 2000 2000 with the permission of the with the permission of the authors and the publisher authors and the publisher

Upload: rafael-duke

Post on 13-Mar-2016

75 views

Category:

Documents


5 download

DESCRIPTION

Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley & Sons, 2000 with the permission of the authors and the publisher. Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Pattern ClassificationClassification

All materials in these slides were taken All materials in these slides were taken from from Pattern Classification (2nd ed) by R. O. Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Duda, P. E. Hart and D. G. Stork, John Wiley & Sons, 2000Wiley & Sons, 2000 with the permission of the authors and with the permission of the authors and the publisherthe publisher

Page 2: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Chapter 4 (Part 1):Chapter 4 (Part 1):Non-Parametric Classification Non-Parametric Classification

(Sections 4.1-4.3)(Sections 4.1-4.3)

• IntroductionIntroduction

• Density EstimationDensity Estimation

• Parzen WindowsParzen Windows

Page 3: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

3

IntroductionIntroduction

• All Parametric densities are unimodal (have a single All Parametric densities are unimodal (have a single local maximum), whereas many practical problems local maximum), whereas many practical problems involve multi-modal densitiesinvolve multi-modal densities

• Nonparametric procedures can be used with arbitrary Nonparametric procedures can be used with arbitrary distributions and without the assumption that the distributions and without the assumption that the forms of the underlying densities are knownforms of the underlying densities are known

• There are two types of nonparametric methods:There are two types of nonparametric methods:

• Estimating PEstimating P(x | (x | j j ) ) • Bypass probability and go directly to a-posteriori probability Bypass probability and go directly to a-posteriori probability estimationestimation

Page 4: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

4Density EstimationDensity Estimation•Basic idea:Basic idea:

• Probability that a vector x will fall in region R is:Probability that a vector x will fall in region R is:

• P is a smoothed (or averaged) version of the density function p(x) if P is a smoothed (or averaged) version of the density function p(x) if we have a sample of size n; therefore, the probability that k points fall in R is we have a sample of size n; therefore, the probability that k points fall in R is then:then:

and the expected value for k is:and the expected value for k is:

E(k) = nP (3)E(k) = nP (3)

(1) 'dx)'x(pP

(2) )P1(P kn

P knkk

Page 5: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

5ML estimation of ML estimation of P = P = is reached foris reached for

Therefore, the ratio k/n is a good estimate Therefore, the ratio k/n is a good estimate for the probability P and hence for the for the probability P and hence for the density function p. density function p.

p(x)p(x) is continuous and that the region is continuous and that the region RR is is so small that p does not vary so small that p does not vary significantly within it, we can write:significantly within it, we can write:

where is a point within where is a point within RR and V the volume enclosed by and V the volume enclosed by RR..

)|P(Max k

Pnkˆ

(4) V)x(p'dx)'x(p

Page 6: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

6Combining equation (1) , (3) and (4) yields:Combining equation (1) , (3) and (4) yields:V

n/k)x(p

Page 7: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

7

Density Estimation (cont.)Density Estimation (cont.)

• Justification of equation (4)Justification of equation (4)

We assume that We assume that p(x)p(x) is continuous and that region is continuous and that region RR is so small that p does not vary significantly is so small that p does not vary significantly within within RR. Since . Since p(x) =p(x) = constant, it is not a part of constant, it is not a part of the sum.the sum.

(4) V)x(p'dx)'x(p

Page 8: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

8

Where: Where: ((RR)) is: a surface in the Euclidean space is: a surface in the Euclidean space RR22

a volume in the Euclidean space a volume in the Euclidean space RR33

a hypervolume in the Euclidean space a hypervolume in the Euclidean space RRnn

Since Since p(x) p(x) p(x’) = p(x’) = constant, therefore in the constant, therefore in the Euclidean space Euclidean space RR33::

)()'x(p'dx)x(1)'x(p'dx)'x(p'dx)'x(p

nVk)x(p and

V).x(p'dx)'x(p

Page 9: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

9

• Condition for convergenceCondition for convergence

The fraction The fraction k/(nV)k/(nV) is a space averaged value of is a space averaged value of p(x).p(x). p(x)p(x) is obtained only if V approaches zero. is obtained only if V approaches zero.

This is the case where no samples are included in This is the case where no samples are included in RR: it is an uninteresting case!: it is an uninteresting case!

In this case, the estimate diverges: it is an In this case, the estimate diverges: it is an uninteresting case!uninteresting case!

fixed)n (if 0)x(plim0k ,0V

)x(plim0k ,0V

Page 10: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

10

• The volume V needs to approach 0 anyway if we The volume V needs to approach 0 anyway if we want to use this estimationwant to use this estimation

•Practically, V cannot be allowed to become small since the Practically, V cannot be allowed to become small since the number of samples is always limitednumber of samples is always limited

•One will have to accept a certain amount of variance in the One will have to accept a certain amount of variance in the ratio k/nratio k/n

•Theoretically, if an unlimited number of samples is available, Theoretically, if an unlimited number of samples is available, we can circumvent this difficultywe can circumvent this difficultyTo estimate the density of x, we form a sequence of regionsTo estimate the density of x, we form a sequence of regionsRR11, , RR22,…,…containing x: the first region contains one sample, the containing x: the first region contains one sample, the second two samples and so on.second two samples and so on.Let Let VVnn be the volume of be the volume of RRnn, k, knn the number of samples falling in the number of samples falling in RRnn and and ppnn(x)(x) be the n be the nthth estimate for estimate for p(x):p(x):

ppnn(x) = (k(x) = (knn/n)/V/n)/Vn n (7)(7)

Page 11: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

11

Three necessary conditions should apply if we want Three necessary conditions should apply if we want ppnn(x)(x) to converge to to converge to p(x):p(x):

There are two different ways of obtaining sequences of regions that satisfy There are two different ways of obtaining sequences of regions that satisfy these conditions:these conditions:

(a) Shrink an initial region where (a) Shrink an initial region where VVnn = 1/ = 1/nn and show that and show that

This is called This is called “the Parzen-window estimation method”“the Parzen-window estimation method”

(b) Specify(b) Specify k knn as some function of n, such as as some function of n, such as kknn = = nn; the volume V; the volume Vnn is is grown until it encloses kgrown until it encloses knn neighbors of x. This is called neighbors of x. This is called “the k“the knn-nearest -nearest neighbor estimation method”neighbor estimation method”

0n/klim )3

klim )2

0Vlim )1

nn

nn

nn

)x(p)x(pnn

Page 12: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

12

Page 13: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

13

Parzen WindowsParzen Windows•Parzen-window approach to estimate densities assume Parzen-window approach to estimate densities assume

that the region that the region RRnn is a d-dimensional hypercube is a d-dimensional hypercube

((x-x((x-xii)/h)/hnn)) is equal to unity if is equal to unity if xxii falls within the hypercube falls within the hypercube of volume of volume VVnn centered at x and equal to zero otherwise. centered at x and equal to zero otherwise.

otherwise0

d , 1,...j 21u 1

(u)

:functionwindow following the be (u) Let) ofedge the of length :(h hV

j

nndnn

Page 14: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

14

•The number of samples in this hypercube is:The number of samples in this hypercube is:

By substituting By substituting kknn in equation (7), we obtain the following in equation (7), we obtain the following estimate:estimate:

PPnn(x)(x) estimates estimates p(x)p(x) as an average of functions of as an average of functions of xx and and the samples the samples (x(xii) (i = 1,… ,n).) (i = 1,… ,n). These functions These functions can be can be

general!general!

ni

1i n

in h

xxk

n

ini

1i nn h

xx V1

n1)x(p

Page 15: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

15

• Illustration

• The behavior of the Parzen-window method

• Case where p(x) N(0,1)Let (u) = (1/(2) exp(-u2/2) and hn = h1/n (n>1)

(h1: known parameter)

Thus:

is an average of normal densities centered at the samples xi.

n

ini

1i nn h

xx h1

n1)x(p

Page 16: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

16

•Numerical results:Numerical results:

For For n = 1n = 1 and and hh11=1=1

For For n = 10n = 10 and and h = 0.1h = 0.1, the contributions of , the contributions of the individual samples are clearly observable !the individual samples are clearly observable !

)1,x(N)xx(e21 )xx()x(p 1

21

2/111

Page 17: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

17

Page 18: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

18

Page 19: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

19

Analogous results are also obtained in two dimensions as illustrated:Analogous results are also obtained in two dimensions as illustrated:

Page 20: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

20

Page 21: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

21•Case where Case where p(x) = p(x) = 11.U(a,b) + .U(a,b) + 22.T(c,d).T(c,d) (unknown (unknown

density) (mixture of a uniform and a triangle density) (mixture of a uniform and a triangle density)density)

Page 22: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

22

Page 23: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

23

• Classification exampleClassification example

In classifiers based on Parzen-window estimation:In classifiers based on Parzen-window estimation:

•We estimate the densities for each category and We estimate the densities for each category and classify a test point by the label corresponding classify a test point by the label corresponding to the maximum posteriorto the maximum posterior

•The decision region for a Parzen-window The decision region for a Parzen-window classifier depends upon the choice of window classifier depends upon the choice of window function as illustrated in the following figure.function as illustrated in the following figure.

Page 24: Chapter 4 (Part 1): Non-Parametric Classification (Sections 4.1-4.3)

Pattern Classification, Ch4 (Part 1)

24