plotInbag | R Documentation |
Plot distribution of the fraction of trees that samples were inbag in the Random Forest model.
plotInbag(x, bins = 10, replace = TRUE, sampsize = NULL, plot = TRUE)
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? |
the ggplot2
object is invisibly returned.
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.
Eric Archer eric.archer@noaa.gov
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.