cv.cornet: Performance measurement

Description Usage Arguments Details Examples

View source: R/functions.R

Description

Compares models for a continuous response with a cut-off value.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cv.cornet(
  y,
  cutoff,
  X,
  alpha = 1,
  nfolds.ext = 5,
  nfolds.int = 10,
  foldid.ext = NULL,
  foldid.int = NULL,
  type.measure = "deviance",
  ...
)

Arguments

y

continuous outcome: vector of length n

cutoff

cut-off point for dichotomising outcome into classes: meaningful value between min(y) and max(y)

X

features: numeric matrix with n rows (samples) and p columns (variables)

alpha

elastic net mixing parameter: numeric between 0 (ridge) and 1 (lasso)

nfolds.ext

number of external folds

nfolds.int

internal fold identifiers: vector of length n with entries between 1 and nfolds.int; or NULL

foldid.ext

external fold identifiers: vector of length n with entries between 1 and nfolds.ext; or NULL

foldid.int

number of internal folds

type.measure

loss function for binary classification: character "deviance", "mse", "mae", or "class" (see cv.glmnet)

...

further arguments passed to cornet or glmnet

Details

Computes the cross-validated loss of logistic and combined regression.

Examples

1
2
3
4
5
6
## Not run: n <- 100; p <- 200
y <- rnorm(n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
loss <- cv.cornet(y=y,cutoff=0,X=X)
loss
## End(Not run)

cornet documentation built on April 19, 2021, 9:07 a.m.