Description Usage Arguments Value Author(s) Examples
View source: R/getTPRandFPRbyThreshold.r
This function provides the true and false positive rates (tpr
and fpr
) for a range of thresholds.
1 | getTPRandFPRbyThreshold(validation_scores, label_pos = 1, thr_range = seq(0,1,0.01))
|
validation_scores |
|
label_pos |
numeric value or factor indicating the positive label. |
thr_range |
a numerical |
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.
Everton Cherman <evertoncherman@gmail.com>
Andre Maletzke <andregustavom@gmail.com>
1 2 3 4 5 6 7 8 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.