plot.varSelRF: Plot a varSelRF object

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

View source: R/varSelRF.R

Description

Plots a varSelRF object, showing the initial variable importances, and the change in OOB error with the number of variables.

Usage

1
2
## S3 method for class 'varSelRF'
plot(x, nvar = NULL, which = c(1, 2), ...)

Arguments

x

The varSelRF object.

nvar

The number of variables for which the initial variable importances should be shown. By default, only the 30 with the largest importance are shown.

which

which plots should be drawn, either 1 (for the initial variable importance plot), 2 (for the change in OOB error with the number of variables) or c(1,2) for drawing both plots

...

Not used.

Value

This function is only used for its side effect 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.

Author(s)

Ramon Diaz-Uriarte rdiaz02@gmail.com

References

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

See Also

varSelRF, randomForest, importance

Examples

1
2
3
4
5
6
7
8
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.vs1
plot(rf.vs1)

Example output

Loading required package: randomForest
randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.
Loading required package: parallel

Backwards elimination on random forest; ntree =  200 ;  mtryFactor =  1 

 Selected variables:
[1] "v1" "v2"

 Number of selected variables: 2 

varSelRF documentation built on May 2, 2019, 3:32 p.m.