I need to write a classifier (model of a Gaussian mixture), which I use to recognize human action. I have 4 video datasets. I choose 3 of them as a set for training and 1 of them as a set of tests. Before applying the gm model on the training set, I ran pca on it.
pca_coeff=princomp(trainig_data);
score = training_data * pca_coeff;
training_data = score(:,1:min(size(score,2),numDimension));
During the testing phase, what should I do? Should I run a new princomp when testing data
new_pca_coeff=princomp(testing_data);
score = testing_data * new_pca_coeff;
testing_data = score(:,1:min(size(score,2),numDimension));
or should i use pca_coeff which i compute for training data?
score = testing_data * pca_coeff;
testing_data = score(:,1:min(size(score,2),numDimension));
source
share