Learn R Programming

fifer (version 1.1)

rfPred: Variable selection in Random Forest

Description

Variable selection for prediction purposes using Random Forest. See rfThresh for complete documentation.

Usage

rfPred(object, importance = "permutation", nfor.pred = 25, nmj = 1,
  outfile = "rfPred.file", named.file = "rfPredResults", ...)

Arguments

object
an object returned from rfInterp
importance
what importance measure should be used? Either "permutation" or "gini."
nfor.pred
number of forests to grow
nmj
a contant used for setting the threshold for variable selection. Higher values indicate a less stringent threshold.
outfile
The file location where the rfPred object should be stored. Defaults to storing it in rfPred.file in the default directory.
named.file
What should the rfPred object be named when saved? Defaults to "rfPredResults".
...
other arguments passed to cforest or randomForest

Value

varselect.pred
The variables selected for Prediction (sorted)
err.interp
The error at each stage of the stepwise variable inclusion.
mean.jump
The threshold for variable inclusion.
stepwise.error
The OOB error rate at each iteration of the stepwise procedure.
num.varselect.pred
The number of variables selected for prediction.
comput.time
Computation time of the procedure.
model
The final model, either a randomForest or cforest object.

See Also

rfInterp, rfThresh

Examples

Run this code
## Not run: ------------------------------------
# data(iris); 
# data = iris; 
# formula = as.formula("Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width")
# thresh = rfThresh(formula, data=iris, nruns=2, importance="permutation"); 
# interp = rfInterp(thresh, importance="permutation");
# predic = rfPred(interp, importance="gini")
# predic
## ---------------------------------------------

Run the code above in your browser using DataLab