rfPermute (version 2.5.2)

plotInbag: 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)

Value

the ggplot2 object is invisibly returned.

Arguments

x

a rfPermute or randomForest model object..

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?

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
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)

Run the code above in your browser using DataLab