Learn R Programming

roclab (version 0.1.4)

summary.cv.roclearn: Summarize Cross-Validation results for linear models

Description

Print a concise summary of cross-validation results for a linear model.

Usage

# S3 method for cv.roclearn
summary(object, ...)

Value

Invisibly returns the input object, after printing a summary to the console.

Arguments

object

A fitted cross-validation object of class "cv.roclearn" (linear).

...

Not used.

Details

This is a method for the generic summary() function, applied to objects of class "cv.roclearn". It prints training settings (loss, penalty, number of folds, the set of candidate \(\lambda\)), the selected optimal \(\lambda\), the corresponding mean and standard deviation of cross-validated AUC, and a truncated table of AUC results across candidate \(\lambda\) values.

Examples

Run this code
set.seed(123)

n <- 100
n_pos <- round(0.2 * n)
n_neg <- n - n_pos
X <- rbind(
  matrix(rnorm(2 * n_neg, mean = -1), ncol = 2),
  matrix(rnorm(2 * n_pos, mean =  1), ncol = 2)
)
y <- c(rep(-1, n_neg), rep(1, n_pos))

cvfit <- cv.roclearn(
  X, y,
  lambda.vec = exp(seq(log(0.01), log(5), length.out = 3)),
  approx=TRUE, nfolds = 2
)

summary(cvfit)

Run the code above in your browser using DataLab