pca

Principal component analysis in Python

I'd like to use principal component analysis (PCA) for dimensionality reduction. Does numpy or scipy already have it, or do I have to roll my own using numpy.linalg.eigh? I don't just want to use singular value decomposition (SVD) because my input data are quite high-dimensional (~460 dimensions), so I think SVD will be slower than com...

how do tell if its better to standardize your data matrix first when you do principal component analysis in R ?

Hi guys , Im trying to do principal component analysis in R . There is 2 ways of doing it , I believe. One is doing principal component analysis right away the other way is standardizing the matrix first using s = scale(m)and then apply principal component analysis. How do I tell what result is better ? What values in particular s...

How to fit a linear regression model with two principal components in R ?

Let's say I have a data matrix d pc = prcomp(d) # pc1 and pc2 are the principal components pc1 = pc$rotation[,1] pc2 = pc$rotation[,2] Then this should fit the linear regression model right? r = lm(y ~ pc1+pc2) But then I get this error : Errormodel.frame.default(formula = y ~ pc1+pc2, drop.unused.levels = TRUE) : unequ...

how to show all the sample principal component plots in R ?

I noticed something in R , say pc is the result of applying PCA to a data matrix and pc$x is my sample principal component matrix . when try plot(pc$x) , it will only plot the first principal component (pc1) against the second (pc2) , but I actually have more than 2 principal components. how do I show all of them ? ...

Principal component and Factor Analysis

Hi, I have some question regarding principal component and factor analysis. For PCA, does it matter whether the eigenvalues are computed from the covariance matrix or the correlation matrix É And what about FA, are the results of the eigenvalues the same if I use the covariance or the correlation matrix É ...

SVM Visualization in MATLAB

How do I visualize the SVM classification once I perform SVM training in Matlab? ...

Incremental PCA

Hi, Lately, I've been looking into an implementation of an incremental PCA algorithm in python - I couldn't find something that would meet my needs so I did some reading and implemented an algorithm I found in some paper. Here is the module's code - the relevant paper on which it is based is mentioned in the module's documentation. I w...

MATLAB is running out of memory but it should not be.

I'm trying to do a PCA on my data using princomp(x) that has been standardized. The data is <16 x 1036800 double>. This runs our of memory which is too be expected except for the fact that this is a new computer, the computer holds 24GB of RAM for data mining. MATLAB even lists the 24GB available on a memory check. Is MATLAB actually run...

C++ vs PHP performance on PCA

May I know whether C++ or PHP is more efficient on running PCA (Principal Component Analysis)? I'm developing a web based system which get uploaded image with php, and then process the image so that I can analyse the image with PCA to find out whether the image match with another image which already stored in database. But I'm wonderin...

PCA: What's wrong with this algorithm?

Can someone please either confirm or correct this Wikipedia algorithm for computing the first principal component? I want a simple implementation of PCA in D, which doesn't have any existing libraries for PCA AFAIK. I've tried implementing this, and it doesn't seem like my results on simple examples match stuff I get from R or Octave. ...

How to find the closest 2 points in a 100 dimensional space with 500,000 points?

I have a database with 500,000 points in a 100 dimensional space, and I want to find the closest 2 points. How do I do it? Update: Space is Euclidean, Sorry. And thanks for all the answers. BTW this is not homework. ...