rf.fs: Random Forest Cross-Valdidation for feature selection

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

Description

Random Forest Cross-Valdidation for feature selection

Usage

1
2
rf.fs(trainx, trainy, cv.fold = 5, scale = "log", step = 0.5,
  mtry = function(p) max(1, floor(sqrt(p))), recursive = FALSE)

Arguments

trainx

matrix or data frame containing columns of predictor variables

trainy

vector of response, must have length equal to the number of rows in trainx

cv.fold

The fold, the defalut is 5.

scale

If "log", reduce a fixed proportion (step) of variables at each step, otherwise reduce step variables at a time

step

If log=TRUE, the fraction of variables to remove at each step, else remove this many variables at a time

mtry

A function of number of remaining predictor variables to use as the mtry parameter in the randomForest call

recursive

Whether variable importance is (re-)assessed at each step of variable reduction

Details

This function shows the cross-validated prediction performance of models with sequentially reduced number of predictors (ranked by variable importance) via a nested cross-validation procedure.

Value

A list with the following three components::

Author(s)

Min-feng Zhu <wind2zhu@163.com>

References

Svetnik, V., Liaw, A., Tong, C. and Wang, T., Application of Breiman's Random Forest to Modeling Structure-Activity Relationships of Pharmaceutical Molecules, MCS 2004, Roli, F. and Windeatt, T. (Eds.) pp. 334-343.

See Also

See rf.cv for the Cross-Validation of Classification and Regression models using Random Forest

Examples

1
2
3
4
training = read.csv(system.file('sysdata/training1.csv', package = 'BioMedR'), header = TRUE)
y = training[, 1]
x = training[, -1]
result = rf.fs(x, y)

BioMedR documentation built on July 5, 2019, 9:03 a.m.