Dear all,
i have a dataset(n samples containing m dimensions,and n﹤m),and i would like to reduce the dimensionality of this data using PCA method("prcomp" function in R).However,it only returns a n-by-n matrix,So how to perform PCA when the dimensionality is greater than the number of samples in R? Thanks in advance.
PCA is working correctly, why would you expect more rows than that?
for example,n=10,m=1000,so the result returns a 10X10 matrix, and the 10 PCs explains 100% variance, but 10 components is far smaller than 1000 features,is it reasonable?
Yes, 10 components is reasonable, since it's impossible for there to be more. In practice, you want fewer than N, as dariober pointed out.
It's because PCs are orthogonal to each other and once you have as many dimensions as datapoints there is no more variation to explain.
Thank you guys for your replies.