if (FALSE) {
## Load package:
library("diversityForest")
## Set seed to make results reproducible:
set.seed(1234)
## Construct multi forest and calculate multi-class and discriminatory VIM values:
data(hars)
model <- multifor(dependent.variable.name = "Activity", data = hars,
num.trees = 100, probability=TRUE)
# NOTE: num.trees = 100 (in the above) would be likely too small for practical
# purposes. This small number of trees was simply used to keep the
# runtime of the example short.
# The default number of trees is num.trees = 5000 for datasets with a maximum of
# 5000 observations and num.trees = 1000 for datasets larger than that.
## By default the estimated class-specific distributions of the num_best=5
## variables with the largest multi-class VIM values are plotted:
plot(model)
## Consider only the 2 variables with the largest multi-class VIM values:
plot(model, num_best = 2)
## Show only the density plots or only the boxplots:
plot(model, plot_type = "density", num_best = 2)
plot(model, plot_type = "boxplot", num_best = 2)
## Show only the plot of the distributions of the multi-class and
## discriminatory VIM values:
plot(model, num_best = 0)
}
Run the code above in your browser using DataLab