Contents
How to do PCA on a training set?
You subtract the mean (and if needed divide by the standard deviation) of the training set, as explained here: Zero-centering the testing set after PCA on the training set. Then you project the data onto the PCs of the training set.
Is it good to do PCA once on whole dataset?
On one hand, the PCA does not make any use of the labels. On the other hand, it does use the test data to do the transformation, so I am afraid it could bias the results. I should mention that in addition to saving me some work, doing the PCA once on the whole dataset would allow me to visualize the dataset for all label sets at once.
Why is PCA not considered to be peaking?
Since PCA is unsupervised, it isn’t “peaking” because you can do the same thing to the unknown samples as you can to the known.
When does PCA not help in classification design?
If between-class variance is small, this bias won’t be much, but in that case neither would PCA help for the classification: the PCA projection then cannot help emphasizing the separation between the classes. The answer to this question depends on your experimental design.
How to do principal component analysis in Weka stack?
Set the filter to PrincipalComponents and and the classifier to whatever classifier you want to use. Train it on the un-transformed training set and you’ll be able to just feed it the untransformed test set. If you really need the modified test set I’d recommend using the knowledge flow tool to make something like this:
Can a PCA be used on a whole data set?
PCA can be done on the whole data set so long as you don’t need to build your model in advance of knowing the data you are trying to predict.
When to use PCA in a classification model?
And if the between-class variance is large compared to the within-class variance, between-class variance will influence the PCA projection. Usually the PCA step is done because you need to stabilize the classification. That is, in a situation where additional cases do influence the model.