View source: R/adaptive-lasso.r
cv.adaptive_lasso | R Documentation |
Using cv.glmnet()
to carry out the adaptive lasso will result in an underestimation of error unless you also apply cross-validation to the initial estimator; this function provides a wrapper to do that.
cv.adaptive_lasso(X, y, nfolds = 10, fold)
X |
Design matrix, as in |
y |
Response vector, as in |
nfolds |
Number of cv folds (default: 10) |
fold |
Which fold each observation belongs to. By default the observations are randomly assigned. |
attach_data(pollution)
cvfit <- cv.adaptive_lasso(X, y)
plot(cvfit)
summary(cvfit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.