1
$\begingroup$

I am using glmnet to perform lasso logisitc regression. The picture shows the zoomed trace plot to illustrate when the first coefficeints pop out, when relaxing lambda. One can see that this happens around log(lambda)=-1.6, which would correspond to a lambda between 0.01 and 0.02.

However when I run cv.glmnet the optimum lambda is always given between 0.09 and 0.10. At this level cv.glmnet gives three coefficients that are not zero and present in the model. When one compares the picture at a lambda level of log(0.09)=-1 which was found by cvglmnet, one realizes that the coefficents only pop out later when lambda gets further relaxed.

I know cv.glmnet finds lambda by performing random cross validation, but the discrepancy between trace plot and cv.glmnet seem to be singificant. Do you have any explanations for that?

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

Meanwhile, I learned that the log used in glmnet is the natural logarithm. It's simple as that and pretty basic.

I was a little confused at the time I asked this question, because I know the natural logarithm as ln and not log. Should have tried out a little more before asking.

Anyway, maybe this pretty basic question might help someone else.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.