detc.ci: DET Curve calculation with CI

View source: R/detc.R

detc.ciR Documentation

DET Curve calculation with CI

Description

From a 'DETs' object, the function extracts or computes the confidence interval (CI) of each DET curve in the object.

Usage

detc.ci(
  dets = NULL,
  conf = 0.95,
  positive = "",
  parallel = TRUE,
  ncores = detectCores(),
  nboot = 2000,
  plot = FALSE,
  ...
)

Arguments

dets

A 'DETs' object which will be used to extract or compute the CIs of the DET curves.

conf

A single numeric value in the (0,1) interval representing the confidence level of the DET curve CI. Default: conf = 0.95.

positive

A string with the name of the 'positive' level used as the reference level of 'response'. If left as the default empty string, the second factor level of 'response' is used.

parallel

Boolean. By default parallel = TRUE. If TRUE, the bootstrap method used to calculate the CI is processed in parallel, using the backend provided by plyr (foreach).

ncores

The number of nodes to be forked for the parallel computation of the CI. Default: the maximum available. None used if parallel = FALSE.

nboot

The number of bootstrap replicates to be used for the computation of the CI. Default: nboot = 2000.

plot

If TRUE, the CIs will be plotted for the DET curves. Default: plot = FALSE.

...

Further attributes that will be passed to the plot function.

Value

A 'DETs' object containing the list of DET curves with their CIs, one per classifier.

Examples


library(DET)
n = 500
# Predictors with normal distribution
set.seed(1235)
scoreNegative1 = rnorm(n, mean = 0.25, sd = 0.125)
set.seed(5321)
scoreNegative2 = rnorm(n, mean = 0.25, sd = 0.125)
set.seed(11452)
scorePositive1 = rnorm(n, mean = 0.55, sd = 0.125)
set.seed(54321)
scorePositive2 = rnorm(n, mean = 0.65, sd = 0.125)
response = as.factor(c(rep(c("diseased"), times = n), rep(c("healthy"), times = n)))
predictor1 = c(scoreNegative1, scorePositive1)
predictor2 = c(scoreNegative2, scorePositive2)
predictors = matrix(c(predictor1, predictor2), ncol = 2)
colnames(predictors) = c("DET1", "DET2")
detCurves = detc(
  response,
  predictors,
  positive = "diseased",
  names = colnames(predictors)
)

# Run in parallel for faster execution by activating the logical argument
# 'parallel' and setting the number of cores of your computer
detCurvesWithConfidenceInterval = detc.ci(
  dets = detCurves,
  positive = "diseased",
  names = colnames(predictors),
  conf = 0.95,
  parallel = TRUE,
  ncores = 2
)


DET documentation built on June 15, 2026, 9:08 a.m.

Related to detc.ci in DET...