I've been trying to implement the CPU GS-PCA algorithm in this paper .

The code starts on page 28

I have a program written a script in python which gives the same output as the C++ program in the paper.

My function looks like this

[T, P, R, L, U] = IterativePCA(theData, numDimensions, 10000, 1.0e-7)

Where theData is the big matrix with the data vectors

numDimensions is the number of dimensions the PCA algorithm projects onto

I'm using 10000 max iterations

and an error tolerance of 1.0e-7

But I still have a question

What are the matricies [T, P, R, L, U] ?

How do I get from them to the new data that has been projected onto the PCA basis?

I can compute this data using

from sklearn.decomposition import PCA


But I want to be able to do it using the iterative method in the paper


1 Answer 1


Section 2.1 in the paper explains that PCA takes a list of vectors

$X = [X^{(0)} | X^{(1)} | ... | X^{(N-1)}]$

and maps it to

$T = [T^{(0)} | T^{(1)} | ... | T^{(N-1)}]$

So I presume $T$ contains the data in the new coordinate system.

It then explains that

$X = T P^T$

So I gather that $P$ contains the principle components.

I'm using the published source code now (instead of the preprint version)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.