In the train function of the caret package it is possible to perform centering and scaling of predictors as in the following example:
knnFit <- train(Direction ~ ., data = training, method = "knn",
preProcess = c("center","scale"))
Setting this transformation in train should give a better evaluation of the performance of the algorithm during resampling.
In this case when I use the model to predict the response for new data should I care about centering and scaling or this operation is included in the final model?
Is the following operation sufficient?
pred <- predict(knnFit, newdata = test)
Thanks!