Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.gafs

Predict new samples


Description

Predict new samples using safs and gafs objects.

Usage

## S3 method for class 'gafs'
predict(object, newdata, ...)

Arguments

object

an object of class safs or gafs

newdata

a data frame or matrix of predictors.

...

not currently used

Details

Only the predictors listed in object$optVariables are required.

Value

The type of result depends on what was specified in object$control$functions$predict.

Author(s)

Max Kuhn

See Also

Examples

## Not run: 

set.seed(1)
train_data <- twoClassSim(100, noiseVars = 10)
test_data  <- twoClassSim(10,  noiseVars = 10)

## A short example
ctrl <- safsControl(functions = rfSA,
                    method = "cv",
                    number = 3)

rf_search <- safs(x = train_data[, -ncol(train_data)],
                  y = train_data$Class,
                  iters = 3,
                  safsControl = ctrl)

rf_search

predict(rf_search, train_data)

## End(Not run)

caret

Classification and Regression Training

v6.0-86
GPL (>= 2)
Authors
Max Kuhn [aut, cre], Jed Wing [ctb], Steve Weston [ctb], Andre Williams [ctb], Chris Keefer [ctb], Allan Engelhardt [ctb], Tony Cooper [ctb], Zachary Mayer [ctb], Brenton Kenkel [ctb], R Core Team [ctb], Michael Benesty [ctb], Reynald Lescarbeau [ctb], Andrew Ziem [ctb], Luca Scrucca [ctb], Yuan Tang [ctb], Can Candan [ctb], Tyler Hunt [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.