Search code examples
pca

Is it required to add mean of original train data to reduced dimension train and test data when using PCA?


I have reduced test and train data dimension using PCA. Now I want to use svm for classification. Do I need to add mean of original train data to pca reduced train and test data by command as follows:

X = bsxfun(@plus, pca_train_out, mean(train_data,1));
Y = bsxfun(@plus, pca_test_out, mean(train_data,1));

Please guide.


Solution

  • No it's not necessary, and might even hurt performance. For SVMs, it's often said that normalizing the input is important. E.g. to have zero mean and a some desired scaling along each dimension.