Description Usage Arguments Details References Examples
CV for the Exclusive Lasso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | cv.exclusive_lasso(
X,
y,
groups,
...,
family = c("gaussian", "binomial", "poisson"),
offset = rep(0, NROW(X)),
weights = rep(1, NROW(X)),
type.measure = c("mse", "deviance", "class", "auc", "mae"),
nfolds = 10,
parallel = FALSE
)
## S3 method for class 'ExclusiveLassoFit_cv'
plot(x, bar.width = 0.01, ...)
|
X |
The matrix of predictors (X) |
y |
The response vector (y) |
groups |
An integer vector of length p indicating group membership.
(Cf. the |
... |
Additional arguments passed to |
family |
The GLM response type. (Cf. the |
offset |
A vector of length n included in the linear predictor. |
weights |
Weights applied to individual
observations. If not supplied, all observations will be equally
weighted. Will be re-scaled to sum to n if
necessary. (Cf. the |
type.measure |
The loss function to be used for cross-validation. |
nfolds |
The number of folds (K) to be used for K-fold CV |
parallel |
Should CV run in parallel? If a parallel back-end for the
|
x |
An |
bar.width |
Width of error bars |
As discussed in Appendix F of Campbell and Allen [1], cross-validation can be quite unstable for exclusive lasso problems. Model selection by BIC or EBIC tends to perform better in practice.
Campbell, Frederick and Genevera I. Allen. "Within Group Variable Selection with the Exclusive Lasso." Electronic Journal of Statistics 11(2), pp.4220-4257. 2017. doi: 10.1214/EJS-1317
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | n <- 200
p <- 500
groups <- rep(1:10, times=50)
beta <- numeric(p);
beta[1:10] <- 3
X <- matrix(rnorm(n * p), ncol=p)
y <- X %*% beta + rnorm(n)
exfit_cv <- cv.exclusive_lasso(X, y, groups, nfolds=5)
print(exfit_cv)
plot(exfit_cv)
# coef() and predict() work just like
# corresponding methods for exclusive_lasso()
# but can also specify lambda="lambda.min" or "lambda.1se"
coef(exfit_cv, lambda="lambda.1se")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.