ffs-deprecated | R Documentation |
A simple forward feature selection algorithm
ffs(predictors, response, method = "rf"
, metric = ifelse(is.factor(response), "Accuracy", "RMSE")
, maximize = ifelse(metric == "RMSE", FALSE, TRUE), withinSD = FALSE
, trControl = trainControl(), tuneLength = 3, tuneGrid = NULL
, seed = sample(1:1000, 1), runParallel = FALSE, ...)
predictors |
see |
response |
see |
method |
see |
metric |
see |
maximize |
see |
withinSD |
Logical Models are only selected if they are better than the currently best models Standard error |
trControl |
see |
tuneLength |
see |
tuneGrid |
see |
seed |
A random number |
runParallel |
Logical |
... |
arguments passed to the classification or regression routine (such as randomForest). Errors will occur if values for tuning parameters are passed here. |
Models with two predictors are first trained using all possible pairs of predictor variables. The best model of these initial models is kept. On the basis of this best model the predictor variables are iteratively increased and each of the remaining variables is tested for its improvement of the currently best model. The process stops if none of the remaining variables increases the model performance when added to the current best model.
The internal cross validation can be run in parallel. See information on parallel processing of carets train functions for details.
Using withinSE will favour models with less variables and probably shorten the calculation time
A list of class train. Beside of the usual train contentm the object contains the vector "selectedvars" and "selectedvars_perf" that give the order of the variables selected as well as their corresponding performance (starting from the first two variables)
This validation is particulary suitable for
leave-one-station-out cross validations where variable selection
MUST be based on the performance of the model on the hold out station.
A computational time expesnsive alternative is the best subset
selection (bss
).
Hanna Meyer
train
, bss
,
trainControl
,rfe
Rsenal-deprecated
## Not run:
data(iris)
ffsmodel <- ffs(iris[,1:4],iris$Species)
ffsmodel$selectedvars
ffsmodel$selectedvars_perf
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.