1

I am having some issues in interpreting the results from prcomp().

Say I have a centered and scaled data.table called dat, with N columns and M rows. Indeed every column represents a feature and every row a record. I also got a M-dimensional vector of outcomes Y.

I wanted to know what the PCA of this system says. So I just executed:

dat.pca=prcomp(dat,retx=TRUE)

By the elbow method I decided to retain 5 PCA modes, accounting for 90% of the variance. Then, I got the following data.table:

dat.pcadata=as.data.table(dat.pca$x)

dat.pcadata has M rows and N columns, and each column corresponds to a PCA mode.

My question is: do I understand correctly if I say that now my system should be trained to forecast the outcomes Y using the first 5 columns of dat.pcadata as features?

Henrik
  • 65,555
  • 14
  • 143
  • 159
marco
  • 569
  • 1
  • 4
  • 19
  • Yes, you understand correctly. Regarding your edit: This is intentional, greetings can be seen as friendly, but ultimately detract from the purpose of the question, which is supposed to serve as an FAQ for future people with the same problem. — Another thing: there’s no need to repeat tags in the question title. – Konrad Rudolph Feb 25 '19 at 11:20
  • Thanks a lot @KonradRudolph for the multiple answers (ok I get your point, but at least in the comments can I say thanks?) – marco Feb 25 '19 at 11:25
  • Yes, absolutely. The rules are a bit oddly specific and strict, it’s unfortunately quite usual for newcomers to get confused by them. – Konrad Rudolph Feb 25 '19 at 11:33

0 Answers0