detc.ci: DET Curve calculation with CI

Description Usage Arguments Value Examples

View source: R/detc.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 into the (0,1) interval, which represents the confidence level of the CI of the DET Curve. Default: conf = 0.95.

positive

A string with the name of the 'positive' level which is setting as reference level of 'response'.

parallel

Boolean. By default parallel = TRUE. If TRUE, the bootstrap method to calculated 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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("target"), times = n), rep(c("nontarget"), 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 = "target",
  names = colnames(predictors)
)

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

DET documentation built on April 3, 2021, 1:06 a.m.

Related to detc.ci in DET...