Say I have a data matrix of size $N \times P$ where $N$ is the number of samples and $P$ is the number of features. Now, if I do principal component analysis, I get another data matrix of size $N \times K$ where $K$ was chosen according to some criteria. My question: if I pick a row (sample) from the $\text{PCA}$ matrix, does it still point to the same sample as in the original data matrix?

In my study the data on each row is from one subject, so I want to know if the correspondence still exists if I use $\text{PCA}$ for feature selection. (I think this is correct but better safe than sorry...!)

  • 3
    $\begingroup$ Yes, it does. $\endgroup$
    – amoeba
    Sep 3, 2014 at 10:51
  • $\begingroup$ Because the question itself deals not with "feature selection" I changed the title and removed unnecessary tags. $\endgroup$
    – ttnphns
    Sep 3, 2014 at 10:56
  • 1
    $\begingroup$ Yes, you can fully reconstruct your original data set using only the output from a PCA analysis of it. $\endgroup$
    – user603
    Sep 3, 2014 at 10:57
  • 3
    $\begingroup$ @Gilles: what could possibly be the reason to change PCA into $\text{PCA}$? $\endgroup$
    – amoeba
    Sep 3, 2014 at 11:25

1 Answer 1


As others said in the comments, yes, it does preserve row order. If you have a standardized data matrix $\mathbf D$ and a rotation matrix $\mathbf \Omega$, you get your rotated samples $\mathbf R$ simply doing:

$$\mathbf D \mathbf \Omega = \mathbf R$$

As you can see, by the matrix multiplication row order is preserved.

$\mathbf \Omega$ is a square matrix with $P$ rows and columns. If you want to reduce the number of PCs all you have to do is keep only the first $K$ columns of $\mathbf \Omega$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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