plotInbag {rfPermute} | R Documentation |
Plot Inbag distribution
Description
Plot distribution of the fraction of trees that samples were inbag in the Random Forest model.
Usage
plotInbag(x, bins = 10, replace = TRUE, sampsize = NULL, plot = TRUE)
Arguments
x |
a |
bins |
number of bins in histogram. |
replace |
was sampling done with or without replacement? |
sampsize |
sizes of samples drawn. Either a single value or vector of sample sizes as long as the number of classes. |
plot |
display the plot? |
Value
the ggplot2
object is invisibly returned.
Note
Red vertical lines on the plot denote the expected inbag rate(s).
These rates are based on the values of replace
and
sampsize
supplied. If not specified, they are set to the
randomForest
defaults. If this is not the
same as the arguments used to run the model, there will be a mismatch in
the location of these indicator lines and the inbag frequency distribution.
Author(s)
Eric Archer eric.archer@noaa.gov
Examples
library(randomForest)
data(mtcars)
sampsize = c(5, 5)
rf <- randomForest(factor(am) ~ ., data = mtcars, ntree = 10)
plotInbag(rf)
rf <- randomForest(factor(am) ~ ., data = mtcars, ntree = 1000)
plotInbag(rf)
rf <- randomForest(factor(am) ~ ., data = mtcars, ntree = 10000)
plotInbag(rf)