On 07/22/2011 07:51 PM, fongchun wrote:
I am using the glmnet R package to run LASSO with binary logistic
regression.
...
What I am finding is that this optimal lambda value fluctuates
everytime I run glmnet with LASSO.
> ...
Does anyone know why there is such a fluctuation  in the
generation of an optimal lambda?

Cross-validation is a random procedure, and the results will vary every time. This reflects the underlying uncertainty regarding the optimal lambda.

Or are you saying that you've used glmnet many times, but this time, the fluctuations in lambda are much larger than usual? If so, and you suspect a problem with the way that glmnet is partitioning the data set into cross-validation folds, you can specify that with the 'foldid' option.

--
Patrick Breheny
Assistant Professor
Department of Biostatistics
Department of Statistics
University of Kentucky

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to