# NOT RUN {
x <- matrix(rnorm(45 * 30), ncol = 30)
x[1:20, 1:2] <- x[1:20, 1:2] + 2
cl <- factor(c(rep("A", 20), rep("B", 25)))
rf <- randomForest(x, cl, ntree = 200, importance = TRUE)
rf.rvi <- randomVarImpsRF(x, cl,
rf,
numrandom = 20,
usingCluster = FALSE)
varSelImpSpecRF(rf, randomImps = rf.rvi)
# }
# NOT RUN {
## Identical, but using a cluster
psockCL <- makeCluster(2, "PSOCK")
clusterSetRNGStream(psockCL, iseed = 456)
clusterEvalQ(psockCL, library(varSelRF))
rf.rvi <- randomVarImpsRF(x, cl,
rf,
numrandom = 20,
usingCluster = TRUE,
TheCluster = psockCL)
varSelImpSpecRF(rf, randomImps = rf.rvi)
stopCluster(psockCL)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab