Having read this question and this link, I already know that model.matrix
can help convert data frame with factors into a design matrix.
My question is if you pass this model.matrix
into glmnet
or cv.glmnet
function with the argument standardize
set to TRUE
, it still scales those dummy variable columns, am I correct ? So it means that glmnet
still cannot differentiate the categorical variables from the continuous variables and handle them differently. So how can I make glmnet standardize the non-categorical columns but not the categorical columns ?