# How to do dimensionality reduction on a huge data set?

I am working with fMRI data of ~1000 subject. Each subject has a feature vector of ~150 million dimension. So I can only keep the feature vectors of ~10 subjects in memory.

What are some algorithms that would enable me to do feature selection/ dimensionality reduction, assuming that I can only keep a fraction of the samples in memory at once?

• But you have only 1000 rows. So, it's possible to perform PCA on matrix XX' instead of X'X. Center columns of X. Eigendecompose XX'. Eigenvectors you’ll get are U, the left eigenvectors of X. Multiply by the S, sq. root of the m (the number of dimensions you want to retain) eigenvalues: US. Here you are, the first m PC scores (1000 x m matrix). It was about dimensionality reduction. Feature selection from 150 million features is another story. – ttnphns Feb 17 '16 at 10:09
• And I believe this question must have been already asked on this site. Please inspect the list of the Qs about PCA. – ttnphns Feb 17 '16 at 10:09
• Thanks @ttnphns. What is this technique called? I would like to find more material about this. Also, can m be larger than 1000? – erensezener Feb 18 '16 at 8:58
• It's again PCA, only performed "through the back door" with the same result. I recommend you to read stats.stackexchange.com/q/79043/3277. The thing is that you can do PCA not only through svd of X or eigen of X'X, but also through sdv of X' or eigen of XX'. If the number of columns of X is huge but the number of rows is modest, the very last approach is the most fast / memory saving, provided that you manage to compute XX'. – ttnphns Feb 18 '16 at 13:46