ggplot of the covariates considered in the
When the number of covariates under consideration is huge, it can be pretty
difficult to read the covariate name from this plot. In this case, user can
identify the name of the covariate that he or she is interested in by
importance.covariate.names from the
importance.forestRK.object that was used in the function call.
importance.covariate.names lists the original names of the covariates
after ordering them from the most important to the least important. So for
example, the exact name of the covariate that has the second highest importance
would be the second element of the vector
and so on.
1 2 3
colour used for the border of the importance plot; default is "dark green".
colour used to fill the bars of the importance plot; default is "dark green" (yes, I like dark green).
size of the labels; default is set to 10.
An importance plot of the covariates considered in the
ordered from the most important covariate to the least important covariate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## 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),] y.train <- y.organizer(iris[c(1:25,51:75,101:125),5])$y.new # random forest # min.num.obs.end.node.tree is set to 5 by default; # entropy is set to TRUE by default # typically the nbags and samp.size has to be much larger than 30 and 50 forestRK.1 <- forestRK(x.train, y.train, nbags = 30, samp.size = 50) # execute forestRK.importance function imp <- importance.forestRK(forestRK.1) # generate importance plot importance.plot.forestRK(imp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.