Lecture 23:
−Principal Component Analysis
Aykut Erdem
January 2019 Hacettepe University
Lecture 23: Principal Component Analysis Aykut Erdem January 2019 - - PowerPoint PPT Presentation
Lecture 23: Principal Component Analysis Aykut Erdem January 2019 Hacettepe University Administrative Project Presentations January 17-18, 2019 Each project group will have ~10 mins to present their work in class. The suggested
−Principal Component Analysis
Aykut Erdem
January 2019 Hacettepe University
January 17-18, 2019
The suggested outline for the presentations are as follows:
is interesting and important)
prepare an engaging video presentation of their work using online tools such as PowToon, moovly or GoAnimate (due January 11, 2019).
2
providing a general motivation and briefly discusses the approach(es) that you explored.
topic.
you employed or proposed as detailed and specific as possible.
analyze the performance of the approach(es) you proposed or explored. You should provide a qualitative and/or quantitative analysis, and comment on your findings. You may also demonstrate the limitations of the approach(es).
key results you obtained. You may also suggest possible directions for future work.
4
Similarity Graph: G(V,E,W) V – Vertices (Data points) E – Edge if similarity > 0 W - Edge weights (similarities) Partition the graph so that edges within a group have large weights and edges across groups have small weights.
Similarity graph
slide by Aarti Singh
5 k-means output Spectral clustering output
slide by Aarti Singh
6
Start with each item in its own cluster, find the best pair to merge into a new
fused together.
slide by Andrew Moore
7
8
9
Instances Features
H-WBC H-RBC H-Hgb H-Hct H-MCV H-MCH H-MCHC H-MCHC A1 8.0000 4.8200 14.1000 41.0000 85.0000 29.0000 34.0000 A2 7.3000 5.0200 14.7000 43.0000 86.0000 29.0000 34.0000 A3 4.3000 4.4800 14.1000 41.0000 91.0000 32.0000 35.0000 A4 7.5000 4.4700 14.9000 45.0000 101.0000 33.0000 33.0000 A5 7.3000 5.5200 15.4000 46.0000 84.0000 28.0000 33.0000 A6 6.9000 4.8600 16.0000 47.0000 97.0000 33.0000 34.0000 A7 7.8000 4.6800 14.7000 43.0000 92.0000 31.0000 34.0000 A8 8.6000 4.8200 15.8000 42.0000 88.0000 33.0000 37.0000 A9 5.1000 4.7100 14.0000 43.0000 92.0000 30.0000 32.0000
slide by Alex Smola
10
20 30 40 50 60 100 200 300 400 500 600 700 800 900 1000 measurement Value
slide by Alex Smola
11
slide by Alex Smola
12
0 50 150 250 350 450 50 100 150 200 250 300 350 400 450 500 550
C-Triglycerides C-LDH
100200300400500 200 400 600 1 2 3 4
C-Triglycerides C-LDH M-EPI
… ¡difficult ¡to ¡see ¡in ¡4 ¡or ¡higher ¡dimensional ¡spaces...
slide by Alex Smola
Even 3 dimensions are already difficult. How to extend this?
13
slide by Barnabás Póczos and Aarti Singh
slide by Andrew Ng
(inches) (cm)
(inches) (cm)
slide by Andrew Ng
slide by Andrew Ng
point with a single categorical variable
data
vector
17
slide by Fereshteh Sadeghi
18
19
20
slide by Barnabás Póczos and Aarti Singh
21
slide by Barnabás Póczos and Aarti Singh
22
slide by Barnabás Póczos and Aarti Singh
23
slide by Barnabás Póczos and Aarti Singh
24
18
i i T i T
m
1 2 1 1 1 2
} )] ( {[ 1 max arg x w w x w w
w
} ) {( 1 max arg
1 2 i 1 1
i T
m x w w
w
We maximize the variance
residual subspace We maximize the variance of projection of x
x’ ¡PCA reconstruction
Given the centered data {x1, ¡…, ¡xm}, compute the principal vectors:
1st PCA vector kth PCA vector x w1 w x’=w1(w1
Tx)
w x-x’
slide by Barnabás Póczos and Aarti Singh
25
19
i k j i T j j i T k
m
1 2 1 1 1
} )] ( {[ 1 max arg x w w x w w
w
We maximize the variance
residual subspace Maximize the variance of projection of x
x’ ¡PCA reconstruction
Given w1,…, ¡wk-1, we calculate wk principal vector as before:
kth PCA vector w1(w1
Tx)
w2(w2
Tx)
x w1 w2 x’=w1(w1
Tx)+w2(w2 Tx)
w
slide by Barnabás Póczos and Aarti Singh
26
i T i
1
i i
1
where
slide by Barnabás Póczos and Aarti Singh
27
A: Square matrix λ: Eigenvector or characteristic vector x: Eigenvalue or characteristic value
28
If we define a new matrix B: If B has an inverse: BUT! an eigenvector cannot be zero!! x will be an eigenvector of A if and only if B does not have an inverse, or equivalently det(B)=0 :
29
Example 1: Find the eigenvalues of two eigenvalues: -1, - 2 Note: The roots of the characteristic equation can be repeated. That is, λ1 = λ2 =…= λk. If that happens, the eigenvalue is said to be of multiplicity k. Example 2: Find the eigenvalues of λ = 2 is an eigenvector of multiplicity 3.
ú û ù ê ë é
5 1 12 2 A ) 2 )( 1 ( 2 3 12 ) 5 )( 2 ( 5 1 12 2
2
+ + = + + = + +
+
l l l l l l l l A I ú ú ú û ù ê ê ê ë é = 2 2 1 2 A ) 2 ( 2 2 1 2
3 =
l l l l A I
30
31
23
Singular Value Decomposition of the centered data matrix X.
samples
significant noise noise noise significant sig.
slide by Barnabás Póczos and Aarti Singh
32
slide by Barnabás Póczos and Aarti Singh
33
34
35
Can’t ¡just ¡use ¡the ¡given ¡256 ¡x ¡256 ¡pixels
slide by Barnabás Póczos and Aarti Singh
36
Example data set: Images of faces
[Turk & Pentland], [Sirovich & Kirby]
Each face x is ¡…
Form X = [ x1 , ¡…, ¡xm ] centered data mtx Compute = XXT Problem: is 64K 64K ¡… ¡HUGE!!!
256 x 256 real values m faces
x1, ¡…, ¡xm
Method A: Build a PCA subspace for each person and check which subspace can reconstruct the test image the best Method B: Build one PCA database for the whole dataset and then classify based on the weights.
27
slide by Barnabás Póczos and Aarti Singh
37
then Xv is eigenvector of Proof: L v = v
256 x 256 real values m faces
x1, ¡…, ¡xm
slide by Barnabás Póczos and Aarti Singh
38
slide by Derek Home
39
slide by Derek Home
40
slide by Barnabás Póczos and Aarti Singh
41
… ¡faster ¡if ¡train ¡with…
slide by Barnabás Póczos and Aarti Singh
42
slide by Barnabás Póczos and Aarti Singh
43
slide by Barnabás Póczos and Aarti Singh
44
slide by Barnabás Póczos and Aarti Singh
45
slide by Barnabás Póczos and Aarti Singh
46
slide by Barnabás Póczos and Aarti Singh
47
slide by Barnabás Póczos and Aarti Singh
48
49
50
slide by Barnabás Póczos and Aarti Singh
51
slide by Barnabás Póczos and Aarti Singh
52
slide by Barnabás Póczos and Aarti Singh
53
2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12
slide by Barnabás Póczos and Aarti Singh
54
slide by Barnabás Póczos and Aarti Singh
55
2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12
slide by Barnabás Póczos and Aarti Singh
56
slide by Barnabás Póczos and Aarti Singh
57
2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12
slide by Barnabás Póczos and Aarti Singh
58
slide by Barnabás Póczos and Aarti Singh
59
slide by Barnabás Póczos and Aarti Singh
60
http://en.wikipedia.org/wiki/Discrete_cosine_transform
slide by Barnabás Póczos and Aarti Singh
61
62
x x’ U x
slide by Barnabás Póczos and Aarti Singh
63
slide by Barnabás Póczos and Aarti Singh
64
slide by Barnabás Póczos and Aarti Singh