# PCA dramatically reduce the accuracy of classification

I am doing classification of this UCI Dataset in Matlab. I represented dataset as matrix (instances x dimensions) and 2nd matrix as (instances x label [instances x 1]).

With Naive Bayess I get accuracy of multiclass classification 0.65. But when I use dataset transformed with PCA I get accuracy only 0.15 even if I use all dimensions. I guess I am doing something wrong. This is my matlab code:

%x_tr, y_tr =training set, labels of training set
%x_tst,y_tst=testing set , labels of testing set
model = fitNaiveBayes(x_tr,y_tr);
Y=predict(model,x_tst);
acc=accuracyMC(Y); %0.65

%PCA usage
[COEFF,SCORE] = princomp(x_tr);
model_pca = fitNaiveBayes(SCORE,y_tr);
[COEFF,SCORE] = princomp(x_tst);
Y=predict(model_pca,SCORE);
acc_pca=accuracyMC(Y); %0.15


I also tried normalize it with z-score.

• possible duplicate of What can cause PCA to worsen results of a classifier? – Sycorax Jun 10 '15 at 13:42
• This thread illustrates a potential pitfall - transforming the sets separately - that the other thread doesn't. So I'm not convinced it is an exact duplicate although the link is certainly useful and relevant to the OP. – Silverfish Jun 10 '15 at 14:42