Description Usage Arguments Value Author(s) See Also Examples
View source: R/importance.plot.forestRK.R
Generates importance ggplot
of the covariates considered in the
forestRK
model.
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
extracting 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 importance.covariate.names
,
and so on.
1 2 3 | importance.plot.forestRK(importance.forestRK.object = importance.forestRK(),
colour.used = "dark green", fill.colour = "dark green",
label.size = 10)
|
importance.forestRK.object |
an |
colour.used |
colour used for the border of the importance plot; default is "dark green". |
fill.colour |
colour used to fill the bars of the importance plot; default is "dark green" (yes, I like dark green). |
label.size |
size of the labels; default is set to 10. |
An importance plot of the covariates considered in the forestRK
model,
ordered from the most important covariate to the least important covariate.
Hyunjin Cho, h56cho@uwaterloo.ca Rebecca Su, y57su@uwaterloo.ca
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.