predict.gafs

0th

Percentile

Predict new samples

Predict new samples using safs and gafs objects.

Keywords
multivariate
Usage
# S3 method for 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.

See Also

safs, gafs

Aliases
  • predict.gafs
  • predict.safs
Examples
# NOT RUN {
# }
# 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)
# }
# NOT RUN {
# }
Documentation reproduced from package caret, version 6.0-80, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.