qpPRscoreThreshold: Calculation of scores thresholds attaining nominal precision...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/qpgraph.R

Description

Calculates the score threshold at a given precision or recall level from a given precision-recall curve.

Usage

1
qpPRscoreThreshold(preRecFun, level, recall.level=TRUE, max.score=9999999)

Arguments

preRecFun

precision-recall function (output from qpPrecisionRecall).

level

recall or precision level.

recall.level

logical; if TRUE then it is assumed that the value given in the level parameter corresponds to a desired level of recall; if FALSE then it is assumed a desired level of precision.

max.score

maximum score given by the method that produced the precision-recall function to an association.

Value

The score threshold at which a given level of precision or recall is attained by the given precision-recall function. For levels that do not form part of the given function their score is calculated by linear interpolation and for this reason is important to carefully specify a proper value for the max.score parameter.

Author(s)

R. Castelo and A. Roverato

References

Fawcett, T. An introduction to ROC analysis. Pattern Recogn. Lett., 27:861-874, 2006.

See Also

qpPrecisionRecall qpGraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
require(mvtnorm)

nVar <- 50  ## number of variables
maxCon <- 5 ## maximum connectivity per variable
nObs <- 30  ## number of observations to simulate

set.seed(123)

A <- qpRndGraph(p=nVar, d=maxCon)
Sigma <- qpG2Sigma(A, rho=0.5)
X <- rmvnorm(nObs, sigma=as.matrix(Sigma))

nrr.estimates <- qpNrr(X, q=1, verbose=FALSE)

nrr.prerec <- qpPrecisionRecall(nrr.estimates, A, decreasing=FALSE,
                                recallSteps=seq(0, 1, by=0.1))

qpPRscoreThreshold(nrr.prerec, level=0.5, recall.level=TRUE, max.score=0)

qpPRscoreThreshold(nrr.prerec, level=0.5, recall.level=FALSE, max.score=0)

qpgraph documentation built on Jan. 10, 2021, 2:01 a.m.