Page 1 of 1

Part I: Principal Component Analysis: PCA can be implemented very simply in Matlab or python. Given a dataset (as a matr

Posted: Sun May 15, 2022 1:26 pm
by answerhappygod
Part I: Principal Component Analysis: PCA can be implemented
very simply in Matlab or python. Given a dataset (as a matrix X),
the covariance matrix can be found using the Matlab covariance
function (cov(X)). Then, the eigenvectors and eigenvalues of this
covariance matrix are the principal component (vectors) and
principal values respectively. The eigenvalues reflect the amount
of variance accounted for by each principal component and are
ordered. To perform dimensionality reduction (e.g. down to 2
dimensions), we need to multiply X by the two eigenvectors with the
largest corresponding eigenvalues. • Read section 6.3 of the
Alpaydin text.
• Write a Matlab function implementing PCA.
(Q1) List the code you have written that implements PCA.
(Q2) Run your PCA function on the MNIST data.
(a) Produce a plot of the data in the space
spanned by the first two principal components. Colour each point by
its class.
(b) What percentage of the data variance is
accounted for by the first two principal components?
(c) From the results, produce a Scree graph
similar to that shown in Fig 6.2 of the Alpaydin text.
(Q3) Repeat the procedure in (Q2) using the Swiss roll dataset.
Comment briefly on the results (a few sentences).
This is figure 6.2
Part I Principal Component Analysis Pca Can Be Implemented Very Simply In Matlab Or Python Given A Dataset As A Matr 1
Part I Principal Component Analysis Pca Can Be Implemented Very Simply In Matlab Or Python Given A Dataset As A Matr 1 (117.15 KiB) Viewed 68 times
(a) Scree graph for Optdigits 200 Eigenvalues 100 0 10 20 30 50 60 70 40 Eigenvectors (b) Proportion of variance explained 0.8 0.6 宫。 Prop. of var. - 0.4 0.2 10 20 50 60 70 30 40 Eigenvectors Figure 6.4 (a) Scree graph. (b) Proportion of variance explained is given for the Optdigits dataset from the UCI Repository. This is a handwritten digit dataset