2

I'm trying to use the caret package to play with alpha levels for a glmnet model. The problem is that the data I'm using is all dummy variables and I don't want glmnet to standardize them. Usually if I was just using glmnet or cv.glmnet on its own, I'd just add

standardize = FALSE

Is there a setting in caret to turn off standardize?

Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
screechOwl
  • 27,310
  • 61
  • 158
  • 267

1 Answers1

5

In caret, you can feed original function arguments into caret::train thanks to the ellipsis ... mechanism.

For example this code will fit a regularized regression on non standardized data

require(caret)
require(mlbench)
data(BostonHousing)

enet <-  train(medv ~ .,
               data = BostonHousing, 
               method = "glmnet",
               standardize = FALSE)
dickoa
  • 18,217
  • 3
  • 36
  • 50