# NOT RUN {
## example: iris dataset
## load the forestRK package
library(forestRK)
## numericize the data
x.train <- x.organizer(iris[,1:4], encoding = "num")[c(1:25,51:75,101:125),]
x.test <- x.organizer(iris[,1:4], encoding = "num")[c(26:50,76:100,126:150),]
y.train <- y.organizer(iris[c(1:25,51:75,101:125),5])$y.new
y.factor.levels <- y.organizer(iris[c(1:25,51:75,101:125),5])$y.factor.levels
## make prediction from a random forest RK model
## typically the nbags and samp.size has to be much larger than 30 and 50
pred.forest.rk <- pred.forestRK(x.test = x.test, x.training = x.train,
y.training = y.train,
y.factor.levels,
min.num.obs.end.node.tree = 6,
nbags = 30, samp.size = 50, entropy = FALSE)
pred.forest.rk$test.prediction.df.list[[10]]
pred.forest.rk$pred.for.obs.forest.rk # etc....
# }
Run the code above in your browser using DataLab