[R] Model selection in LASSO (cross-validation)
WQ Y
hi_squirrel at hotmail.com
Thu Mar 15 22:04:11 CET 2007
Hi, I know how to use LASSO for model selection based on the Cp criterion.
I heard that we can also use cross validation as a criterion too. I used
cv.lars to give me the lowest predicted error & fraction. But I'm short of
a step to arrive at the number of variables to be included in the final
model. How do we do that? Is it the predict.lars function? i tried >
logprostate.plars.cv=predict.lars(logprostate.lars.cv, M, type = "fit",
mode="fraction") but it gives me error message:
Error in dim(data) <- dim : attempt to set an attribute on NULL. Please
help!
thanks!
_________________________________________________________________
With tax season right around the corner, make sure to follow these few
simple tips.
More information about the R-help
mailing list