I am using the caret
package in R
for training of binary SVM classifiers. For reduction of features I am preprocessing with PCA using the built in feature preProc=c("pca")
when calling train()
. Here are my questions:
- How does caret select principal components?
- Is there a fixed number of principal components that is selected?
- Are principal components selected by some amount of explained variance (e.g. 80%)?
- How can I set the number of principal components used for classification?
- (I understand that PCA should be part of the outer cross-validation to allow reliable prediction estimates.) Should PCA also be implemented in the inner cross-validation cycle (parameter estimation)?
- How does caret implement PCA in the cross-validation?