cv.exclusive_lasso: CV for the Exclusive Lasso

Description Usage Arguments Details References Examples

View source: R/cv.R

Description

CV for the Exclusive Lasso

Usage

 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, ...)

Arguments

X

The matrix of predictors (X)

y

The response vector (y)

groups

An integer vector of length p indicating group membership. (Cf. the index argument of grpreg)

...

Additional arguments passed to exclusive_lasso.

family

The GLM response type. (Cf. the family argument of glm)

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 weight argument of lm)

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 foreach package is registered, it will be used. See the foreach documentation for details of different backends.

x

An ExclusiveLassoFit_cv object as produced by cv.exclusive_lasso.

bar.width

Width of error bars

Details

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.

References

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

Examples

 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")

DataSlingers/ExclusiveLasso documentation built on April 17, 2020, 4:11 a.m.