Description Usage Arguments Value Author(s) Examples
View source: R/KUIPER_method.r
It quantifies events based on testing scores, applying an adaptation of the Kuiper's test for quantification problems.
1 | KUIPER(p.score, n.score, test)
|
p.score |
a numeric |
n.score |
a numeric |
test |
a numeric |
A numeric vector containing the class distribution estimated from the test set.
Denis dos Reis <denismr@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(randomForest)
library(caret)
cv <- createFolds(aeAegypti$class, 3)
tr <- aeAegypti[cv$Fold1,]
validation <- aeAegypti[cv$Fold2,]
ts <- aeAegypti[cv$Fold3,]
# -- Getting a sample from ts with 80 positive and 20 negative instances --
ts_sample <- rbind(ts[sample(which(ts$class==1),80),],
ts[sample(which(ts$class==2),20),])
scorer <- randomForest(class~., data=tr, ntree=500)
scores <- cbind(predict(scorer, validation, type = c("prob")), validation$class)
test.scores <- predict(scorer, ts_sample, type = c("prob"))
KUIPER(p.score = scores[scores[,3]==1,1], n.score = scores[scores[,3]==2,1],
test = test.scores[,1])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.