Skip to contents

Discrimination assessment for binary classifier

Usage

assess_discrimination(
  y_true,
  y_pred,
  y_pred_ref = NULL,
  n_bootstrap = 1000L,
  confidence = 0.95,
  random_state = 42L
)

Arguments

y_true

Integer 0/1 vector.

y_pred

Predicted probabilities.

y_pred_ref

Optional reference-model probabilities for NRI/IDI.

n_bootstrap

Bootstrap reps for AUC CI.

confidence

Confidence level.

random_state

Seed.

Value

An object of class "class_name".

Examples

set.seed(1)
X <- matrix(rnorm(200 * 3), 200, 3)
y <- as.integer(plogis(X[, 1]) > runif(200))
p <- plogis(X %*% c(1, -0.5, 0))
res <- assess_discrimination(y, p, n_bootstrap = 50L)
res$auroc
#> [1] 0.7408668