Download - PCA (Principal Component Analysis)
![Page 1: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/1.jpg)
PCA (Principal Component Analysis)
Training
Prof. Seewhy Lee Presents
![Page 2: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/2.jpg)
Agenda
1. PCA
2. Example
3. Homework
![Page 3: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/3.jpg)
1. PCA
![Page 4: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/4.jpg)
Eigenvalue, Eigenvector
![Page 5: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/5.jpg)
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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/6.jpg)
2. Example
![Page 7: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/7.jpg)
Given Data
x1 1 2 2 3
x2 2 1 2 3
![Page 8: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/8.jpg)
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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/9.jpg)
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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/10.jpg)
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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/11.jpg)
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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/12.jpg)
Data Transformation
11
11
2
1:MatrixtionTransforma
2)2(
1)2(
2)1(
1)1(
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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/13.jpg)
Result
![Page 14: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/14.jpg)
3. Homework
![Page 15: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/15.jpg)
① 열 개 이상의 데이터를 X 비슷한 모양이 되도록 배치한다 . 이것이 N 개의 x 벡터이다 .
② 평균을 계산하여 x 벡터에서 뺀다 . N 개의 y(=x-μ) 벡터이다 .
![Page 16: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/16.jpg)
③ 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)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/17.jpg)
⑥ Eigenvector v 의 크기를 구한 다음 규격화한 것이 Eigenvector q 이다 .
⑦ 규격화된 두 아이겐벡터가 변환행렬 Q 가 된다 . 성분 배치에 주의
vvq /
Eigenvector 1
Eigenvector 2
![Page 18: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/18.jpg)
⑧ 행렬 곱 명령어 mmult 이용하여 벡터 y 를 Q 로 변환한다 . z=Qy.
⑨ z 를 그래프로 그린다 .
⑩ 학번 _ 성명 .xlsx 파일을 e-Class 에 제출
![Page 19: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/19.jpg)
Can you feel the usefulness?
PCA
![Page 20: PCA (Principal Component Analysis)](https://reader034.vdocuments.site/reader034/viewer/2022051316/56813bd7550346895da4ff78/html5/thumbnails/20.jpg)