I'm a total beginner in ML, R, you name it and I'm using FactoMineR's PCA function on my training set to find the principal components of my data.
res_pca <- PCA(training, scale.unit=TRUE, graph=FALSE)
Now I have to project my training data onto the space spanned by the vectors found by PCA. How do I do that?
This is what I've tried:
# get_pca_var is from the factoextra package
var <- get_pca_var(res_pca)
# training_no_target is just the training dataset without the target variable, which is a factor
train_pca <- as.matrix(training_no_target) %*% var$coord
train_pca <- data.frame(train_pca)
I think train_pca
should now contain the final dataset onto which training my models... is this right?