DyS {mlquantify} | R Documentation |
DyS Framework
Description
DyS is a framework for quantification data based on mixture models method. It quantifies events based on testing scores, applying the DyS framework proposed by Maletzke et al. (2019). It also works with several similarity functions.
Usage
DyS(p.score, n.score, test, measure="topsoe", bins=seq(2,20,2), err=1e-5)
Arguments
p.score |
a numeric |
n.score |
a numeric |
test |
a numeric |
measure |
measure used to compare the mixture histogram against the
histogram obtained from the test set. Several functions can be used (Default:
|
bins |
a numeric |
err |
a numeric value defining the accepted error for the ternary search
(default: |
Value
A numeric vector containing the class distribution estimated from the test set.
References
Maletzke, A., Reis, D., Cherman, E., & Batista, G. (2019). DyS: a Framework for Mixture Models in Quantification. in Proceedings of the The Thirty-Third AAAI Conference on Artificial Intelligence, ser. AAAI’19, 2019. <doi.org/10.1609/aaai.v33i01.33014552>.
Examples
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"))
DyS(p.score = scores[scores[,3]==1,1], n.score = scores[scores[,3]==2,1],
test = test.scores[,1])