plot.varSelRFBoot: plot a varSelRFBoot object

Description Usage Arguments Value Warning Note Author(s) References See Also Examples

View source: R/varSelRF.R

Description

Plots of out-of-bag predictions and OOB error vs. number of variables.

Usage

1
2
3
4
5
6
## S3 method for class 'varSelRFBoot'
plot(x,  oobProb = TRUE,
                  oobProbBoxPlot = FALSE,
                  ErrorNum = TRUE,
                  subject.names = NULL,
                  class.to.plot = NULL,...)

Arguments

x

An object of class varSelRFBoot, such as returned by function varSelRFBoot.

oobProb

If TRUE plot (average) out-of-bag predictions. See prob.predictions in varSelRFBoot for more details about the out-of-bag predictions.

oobProbBoxPlot

If TRUE plot a box-plot of out-of-bag predictions.

ErrorNum

If TRUE plot OOB error (as returned by random forest) vs. the number of variables.

subject.names

If not NULL, a vector, of the same length as the number of cases (samples or subjects) with IDs for the cases/samples/subjects, that will be shown to the left of the average out-of-bag prediction.

class.to.plot

If not NULL, an integer or a vector of integers. These integers are those class levels for which out-of-bag predictions plots will be returned.

...

Not used.

Value

This function is only used for its side effects of producing plots.

Warning

The OOB Error rate is biased down (and can be severely biased down) because we do (potentially many) rounds of reducing the set of predictor variables until we minimize this OOB error rate. Note, however, that this is NOT the error rate reported as the estimate of the error rate for the procedure (for which we use the .632+ bootstrap rule).

Note

When plotting the out-of-bag predictions, we show one plot for each class. This is an overkill for two-class problems, but not necessarily for problems with more than two classes. Use class.to.plot to plot only those classes that interest you.

Author(s)

Ramon Diaz-Uriarte rdiaz02@gmail.com

References

Breiman, L. (2001) Random forests. Machine Learning, 45, 5–32.

Diaz-Uriarte, R. and Alvarez de Andres, S. (2005) Variable selection from random forests: application to gene expression data. Tech. report. http://ligarto.org/rdiaz/Papers/rfVS/randomForestVarSel.html

Efron, B. & Tibshirani, R. J. (1997) Improvements on cross-validation: the .632+ bootstrap method. J. American Statistical Association, 92, 548–560.

See Also

randomForest, varSelRF, summary.varSelRFBoot, varSelRFBoot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
## This is a small example, but can take some time.

x <- matrix(rnorm(25 * 30), ncol = 30)
x[1:10, 1:2] <- x[1:10, 1:2] + 2
cl <- factor(c(rep("A", 10), rep("B", 15)))  

rf.vs1 <- varSelRF(x, cl, ntree = 200, ntreeIterat = 100,
                   vars.drop.frac = 0.2)
rf.vsb <- varSelRFBoot(x, cl,
                       bootnumber = 10,
                       usingCluster = FALSE,
                       srf = rf.vs1)
rf.vsb
summary(rf.vsb)
plot(rf.vsb)

## End(Not run)

rdiaz02/varSelRF documentation built on May 27, 2019, 3:06 a.m.