TruePositiveRate | R Documentation |
Let the set of predictions be described by a logical vector
'pred', and let the corresponding trues by described in a logical vector
'true' of the same length. Then, the true positive rate is given by the
expression:
sum(pred & true)/sum(true)
. The false positive rate is given by the
expression:
sum(pred & !true)/sum(!true)
. If these expressions do not give a
finite number, NA_real_
is returned.
TruePositiveRate(pred, true)
FalsePositiveRate(pred, true)
pred , true |
vectors of the same positive length that can be converted to logical. |
a double between 0 and 1 or NA_real_
if the result is not a
finite number.
TruePositiveRate(c(1,0,1,1), c(1,1,0,1))
TruePositiveRate(c(0,0,0,0), c(1,1,0,1))
TruePositiveRate(c(1,1,1,1), c(1,1,0,1))
FalsePositiveRate(c(1,0,1,1), c(1,1,0,1))
FalsePositiveRate(c(0,0,0,0), c(1,1,0,1))
FalsePositiveRate(c(1,1,1,1), c(1,1,0,1))
TruePositiveRate(c(1,0,1,1), c(0,0,0,0))
FalsePositiveRate(c(1,0,1,1), c(1,1,1,1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.