Dummy variables and preProcess

I have a data frame with some dummy variables that I want to use as a training set for glmnet.

As I use glmnet, I want to center and scale the functions using the option preProcessin the function train. I do not want this conversion to apply to dummy variables.

Is there a way to prevent the conversion of these variables?

+5
source share
2 answers

There is no (currently) way to do this, other than writing a custom model for this (see the example with PLS and RF near the end).

, , . , , , , . , (, Species* Speciesversicolor Speciesvirginica), .

+1

. : , (, , , pca). ?

0

All Articles