20
PCA (Principal Component Analysis) Training Prof. Seewhy Lee Presents

PCA (Principal Component Analysis)

  • Upload
    niyati

  • View
    142

  • Download
    8

Embed Size (px)

DESCRIPTION

PCA (Principal Component Analysis). Training. Prof. Seewhy Lee Presents. 1. PCA 2. Example 3. Homework. 1. P CA. Eigenvalue, Eigenvector. Principal Component Analysis. 2 . Example. Given Data. Make Zero Mean. Correlation Matrix. Eigenvalues & Eigenvectors. In Two Dim. - PowerPoint PPT Presentation

Citation preview

Page 1: PCA (Principal Component Analysis)

PCA (Principal Component Analysis)

Training

Prof. Seewhy Lee Presents

Page 2: PCA (Principal Component Analysis)

Agenda

1. PCA

2. Example

3. Homework

Page 3: PCA (Principal Component Analysis)

1. PCA

Page 4: PCA (Principal Component Analysis)

Eigenvalue, Eigenvector

Page 5: PCA (Principal Component Analysis)

Principal Component Analysis

NiN

iiN

k

k ,,1,,1

:MeanZeroMake )()(

1

)(

μxyxμ

MjiyyRN

k

jk

ik

ij ,,1),(,:MatrixnCorrelatio1

)()(

vectorsdim.:1,:DataGiven )( mNii x

)()()(:EquationEigenvalue iii qRq

MjiqQ ji

ij ,,1),(,:MatrixtionTransforma )(

Niii ,,1,:tionTransforma Data )()( Qyz

1 thatso Normalize )( iq

Page 6: PCA (Principal Component Analysis)

2. Example

Page 7: PCA (Principal Component Analysis)

Given Data

x1 1 2 2 3

x2 2 1 2 3

Page 8: PCA (Principal Component Analysis)

Make Zero Mean

y1 -1 0 0 1

y2 0 -1 0 1

x1 1 2 2 3

x2 2 1 2 3 )2,2(μ

Page 9: PCA (Principal Component Analysis)

Correlation Matrix

y1 -1 0 0 1

y2 0 -1 0 1

MjiyyRN

k

jk

ik

ij ,,1),(,:MatrixnCorrelatio1

)()(

21

12R

Page 10: PCA (Principal Component Analysis)

Eigenvalues & Eigenvectors

21

12R

021

12

IR

3,1,0342

1

1

2

1,,0,

21

12 )1(1221

2

1

2

1 qqqqqq

q

q

q

1

1

2

1,,3

21

12 )2(12

2

1

2

1 qqqq

q

q

q

Page 11: PCA (Principal Component Analysis)

In Two Dim.

02221

1211

RR

RRIR

0)(Det)( 22112 R RR

12111211

2221

1211

/)(

1,)(,

RRy

xyRxR

y

x

y

x

RR

RR

Page 12: PCA (Principal Component Analysis)

Data Transformation

11

11

2

1:MatrixtionTransforma

2)2(

1)2(

2)1(

1)1(

qq

qqQ

y1 -1 0 0 1

y2 0 -1 0 1

2

0

2

1,

0

0,

1

1

2

1,

1

1

2

1 )4()3()2()1( zzzz

Page 13: PCA (Principal Component Analysis)

Result

Page 14: PCA (Principal Component Analysis)

3. Homework

Page 15: PCA (Principal Component Analysis)

① 열 개 이상의 데이터를 X 비슷한 모양이 되도록 배치한다 . 이것이 N 개의 x 벡터이다 .

② 평균을 계산하여 x 벡터에서 뺀다 . N 개의 y(=x-μ) 벡터이다 .

Page 16: PCA (Principal Component Analysis)

③ SUMSQ, SUMPRODUCT 함수 이용하여 Correlation Matrix 를 계산한다 .

④ 두 Eigenvalue 를 구한다 . 복잡하므로 조심조심 ㅋ

⑤ Eigenvector 를 구한다 . 이것은 아직 규격화되지 않은 상태 .

2/)(Det*4222112211

RRRRR

)/(,1 1211 RR v

MjiyyRN

k

jk

ik

ij ,,1),(,1

)()(

Page 17: PCA (Principal Component Analysis)

⑥ Eigenvector v 의 크기를 구한 다음 규격화한 것이 Eigenvector q 이다 .

⑦ 규격화된 두 아이겐벡터가 변환행렬 Q 가 된다 . 성분 배치에 주의

vvq /

Eigenvector 1

Eigenvector 2

Page 18: PCA (Principal Component Analysis)

⑧ 행렬 곱 명령어 mmult 이용하여 벡터 y 를 Q 로 변환한다 . z=Qy.

⑨ z 를 그래프로 그린다 .

⑩ 학번 _ 성명 .xlsx 파일을 e-Class 에 제출

Page 19: PCA (Principal Component Analysis)

Can you feel the usefulness?

PCA

Page 20: PCA (Principal Component Analysis)