0

I am struggling to find information about how the standardize = TRUE option as part of the glmnet or cv.glmnet calls works. My understanding (although it might be wrong) is that when the standardization is made as part of the let say the cv.glmnet call with 5-fold CV

cv.lasso <- cv.glmnet(x=x, y=y, alpha=1, family="binomial", nfolds=5, 
                         standardize = TRUE)

it is carried out separately on the 4 training folds and separately on the 1 testing fold, rather than on the dataset as a whole as in the case if done outside the cv.glmnet call using Caret for example. Is this correct? And if this is the case, does that mean that the standardize = TRUE option should not be used with LOOCV (i.e. when the nfolds = number of observations) as in this case the hold out sample can not be standardised since it is just a single observation.

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
odar
  • 101

0 Answers0