#############################
## Evaluation of ##
## LDA ##
#############################
library(TH.data)
library(MASS)
data(GlaucomaM)
head(GlaucomaM)
mylda <- function(formula, train, test){
model <- lda(formula, train)
predict(model, test)$posterior[,"pos"]
}
set.seed(1102013)
ACC <- Daim(Class~., model=mylda, data=GlaucomaM, labpos="glaucoma",
control=Daim.control(method="boot", number=50))
ACC
summary(ACC)
## Not run:
# ## just because of checking time on CRAN
#
#
# ####
# #### optimal cut point determination
# ####
#
#
# set.seed(1102013)
# ACC <- Daim(Class~., model=mylda, data=GlaucomaM, labpos="glaucoma",
# control=Daim.control(method="boot", number=50), cutoff="0.632+")
# ACC
# summary(ACC)
#
#
#
# ####
# #### for parallel execution on multicore CPUs and computer clusters
# ####
#
# library(parallel)
# ###
# ### create cluster with two slave nodes
#
# cl <- makeCluster(2)
#
# ###
# ### Load used package on all slaves and execute Daim in parallel
# ###
#
# clusterEvalQ(cl, library(ipred))
# ACC <- Daim(Class~., model=mylda, data=GlaucomaM, labpos="glaucoma", cluster=cl)
# ACC
#
#
# ####
# #### for parallel computing on multicore CPUs
# ####
#
# ACC <- Daim(Class~., model=mylda, data=GlaucomaM, labpos="glaucoma", multicore=TRUE)
# ACC
#
#
#
#
#
# #############################
# ## Evaluation of ##
# ## randomForrest ##
# #############################
#
#
# library(randomForest)
#
# myRF <- function(formula, train, test){
# model <- randomForest(formula, train)
# predict(model,test,type="prob")[,"pos"]
# }
#
# ACC2 <- Daim(Class~., model=myRF, data=GlaucomaM, labpos="glaucoma",
# control=Daim.control(number=50))
# ACC2
# summary(ACC2)
#
#
# ####
# #### optimal cut point determination
# ####
#
#
# set.seed(1102013)
# ACC2 <- Daim(Class~., model=myRF, data=GlaucomaM, labpos="glaucoma",
# control=Daim.control(method="boot", number=50), cutoff="0.632+")
# summary(ACC2)
#
#
#
# ####
# #### for parallel execution on multicore CPUs and computer clusters
# ####
#
#
# library(parallel)
# ###
# ### create cluster with two slave nodes
#
# cl <- makeCluster(2)
#
# ###
# ### Load used package on all slaves and execute Daim in parallel
# ###
#
# clusterEvalQ(cl, library(randomForest))
# ACC2 <- Daim(Class~., model=myRF, data=GlaucomaM, labpos="glaucoma", cluster=cl)
# ACC2
#
# ####
# #### for parallel computing on multicore CPUs
# ####
#
# ACC2 <- Daim(Class~., model=myRF, data=GlaucomaM, labpos="glaucoma", multicore=TRUE)
# ACC2
# ## End(Not run)
Run the code above in your browser using DataLab