getTPRandFPRbyThreshold {mlquantify} | R Documentation |
Estimates true and false positive rates
Description
This function provides the true and false positive rates (tpr
and fpr
) for a range of thresholds.
Usage
getTPRandFPRbyThreshold(validation_scores, label_pos = 1, thr_range = seq(0,1,0.01))
Arguments
validation_scores |
|
label_pos |
numeric value or factor indicating the positive label. |
thr_range |
a numerical |
Value
data.frame
where each row has both (tpr
and fpr
) rates for
each threshold value. This function varies the threshold from 0.01 to 0.99 with
increments 0.01.
Author(s)
Everton Cherman <evertoncherman@gmail.com>
Andre Maletzke <andregustavom@gmail.com>
Examples
library(randomForest)
library(caret)
cv <- createFolds(aeAegypti$class, 2)
tr <- aeAegypti[cv$Fold1,]
validation <- aeAegypti[cv$Fold2,]
scorer <- randomForest(class~., data=tr, ntree=500)
scores <- cbind(predict(scorer, validation, type = c("prob")), validation$class)
TprFpr <- getTPRandFPRbyThreshold(scores)
[Package mlquantify version 0.2.0 Index]