Why need to tune lambda with caret::train(..., method = "glmnet") and cv.glmnet()?

Viewed 4926

As we can see that caret::train(..., method = "glmnet") with cross-validation or cv.glmnet() implemented both could find the lambda.min which minimize the cross-validation error. The final best fitted model should be the one fitted with lambda.min. Then, why do we need to set a grid of lambda values to the training process?

1 Answers
Related