cv.gren: Performance cross-validation of group-regularized logistic...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Function that cross-validations for performance estimation of gren models.

Usage

1
2
3
4
5
6
cv.gren(x, y, m=rep(1, nrow(x)), unpenalized=NULL, partitions=NULL, alpha=0.5, 
        lambda=NULL, intercept=TRUE, monotone=NULL, psel=TRUE, compare=TRUE, 
        posterior=FALSE, nfolds=nrow(x), foldid=NULL, trace=TRUE,
        control=list(epsilon=0.001, maxit=500, maxit.opt=1000, maxit.vb=100),
        keep.pred=TRUE, fix.lambda=FALSE, nfolds.out=nrow(x), foldid.out=NULL,
        type.measure=c("auc", "deviance", "class.error"))

Arguments

x

See gren.

y

See gren.

m

See gren.

unpenalized

See gren.

partitions

See gren.

alpha

See gren.

lambda

See gren.

intercept

See gren.

monotone

See gren.

psel

See gren.

compare

See gren.

posterior

See gren.

nfolds

See gren.

foldid

See gren.

trace

if TRUE, progress of the cross-validation is printed.

control

See gren.

keep.pred

logical. If TRUE the cross-validated predictions are saved.

fix.lambda

logical. If TRUE lambda is cross-validated only once and used in every fold.

nfolds.out

numeric that gives the number of folds to use in the performance cross-validation. Default is nrow(x).

foldid.out

optional numeric vector of length nrow(x) with the performance cross-validation fold assignments of the observations.

type.measure

numeric that gives the performance measures to calculate. Currently possible are AUC, deviance, and misclassification error.

Details

cv.gren is a convenience function that gives cross-validated predictions. Performance measures are optionally calculated with these predictions. cv.gren is more efficient than simply looping over the folds, since it uses the final estimates of the previous fold as starting values for the next fold. This substantially reduces computation time.

Value

Function returns a list of length two with the following components:

groupreg

list with the cross-validated predictions of length nrow(x) and possibly performance metrics of the group-regularized model.

regular

list with the cross-validated predictions of length nrow(x) and possibly performance metrics of the regular model.

Author(s)

Magnus M. Münch <m.munch@vumc.nl>

References

Münch, M.M., Peeters, C.F.W., van der Vaart, A.W., and van de Wiel, M.A. (2018). Adaptive group-regularized logistic elastic net regression. arXiv:1805.00389v1 [stat.ME].

See Also

gren, predict.gren, coef.gren

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Create data
p <- 1000
n <- 100
set.seed(2018)
x <- matrix(rnorm(n*p), ncol=p, nrow=n)
beta <- c(rnorm(p/2, 0, 0.1), rnorm(p/2, 0, 1))
m <- rep(1, n)
y <- rbinom(n, m, as.numeric(1/(1 + exp(-x %*% as.matrix(beta)))))
partitions <- list(groups=rep(c(1, 2), each=p/2))

## calculate cross-validated predictions and performance measures
fit.cv.gren <- cv.gren(x, y, m, partitions=partitions, fix.lambda=TRUE)

gren documentation built on May 1, 2019, 7:31 p.m.