Principal Components Analysis as an unsupervised linear dimensionality reduction
ID: 2922187 • Letter: P
Question
Principal Components Analysis as an unsupervised linear dimensionality reduction framework achieves impressive performance many among state-of-art techniques. An original dataset has been shown in Table 1. Questions (30 marks) • Calculate the covariance matrix of data as shown in the Table 1. • Calculate eigenvectors and eigenvalues of the covariance matrix. • Calculate the proportion of total population variance explained by the first two components
Table 1: An Original Dataset Attributes 1 Attributes 2 Attributes 3 ID 3 -3 6 3 7 1Explanation / Answer
here we used the R to do the whole calculate thye whole distribution ...
R codes
x1=c(-1,-2,-3,1,2,3,1)
x2=c(-1,-1,-2,1,1,2,2)
x3=c(1,4,-2,1,2,1,4)
a=var(x1)
b=var(x2)
c=var(x3)
d=cov(x1,x2)
e=cov(x1,x3)
f=cov(x2,x3)
m=matrix(c(a,d,e,d,b,f,e,f,c),ncol=3,byrow=T)
m
var-cov matrix is
4.809524 3.285714 1.238095
3.285714 2.571429 1.476190
1.238095 1.476190 4.285714
eigen values and eigen vectors
R-code
a=eigen(m)
a
output
$values
[1] 8.0850820 3.4255032 0.1560815
$vectors
[,1] [,2] [,3]
0.7127562 - 0.4373436 0.5483696
0.5434668 -0.1499041 -0.8259374
0.4434213 0.8867127 0.1308366
population varinace explained by the first two principal components
r code
b=a$values
b
c=sum(b)
d=(b[1]+b[2])/c
d
out-put
0.9866216
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.