boot_auc: Compute the bootstrap-corrected estimator of AUC.

Description Usage Arguments Value Examples

View source: R/auc_functions.R

Description

This estimator is computed by re-sampling with replacement (i.e., bootstrap sampling) from the data. The AUC is computed for the learner trained on the full data. The AUC is then computed for the learner trained on each bootstrap sample. The average difference between the full data-trained learner and the bootstrap-trained learner is computed to estimate the bias in the full-data-estimated AUC. The final estimate of AUC is given by the difference in the full-data AUC and the estimated bias.

Usage

1
boot_auc(Y, X, B = 500, learner = "glm_wrapper", correct632 = FALSE, ...)

Arguments

Y

A numeric vector of outcomes, assume to equal 0 or 1.

X

A data.frame of variables for prediction.

B

The number of bootstrap samples.

learner

A wrapper that implements the desired method for building a prediction algorithm. See ?glm_wrapper or read the package vignette for more information on formatting learners.

correct632

A boolean indicating whether to use the .632 correction.

...

Other options, not currently used.

Value

A list with $auc as the bootstrap-corrected AUC estimate and $n_valid_boot as the number of bootstrap of bootstrap samples where learner successfully executed.

Examples

1
2
3
4
5
6
# simulate data
X <- data.frame(x1 = rnorm(50))
Y <- rbinom(50, 1, plogis(X$x1))
# compute lpo_auc for logistic regression 
# use small B for fast run
boot <- boot_auc(Y = Y, X = X, B = 25, learner = "glm_wrapper")

nlpred documentation built on Feb. 24, 2020, 1:11 a.m.