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

update.safs

Update or Re-fit a SA or GA Model


Description

update allows a user to over-ride the search iteration selection process.

Based on the results of plotting a gafs or safs object, these functions can be used to supersede the number of iterations determined analytically from the resamples.

Any values of ... originally passed to gafs or safs are automatically passed on to the updated model (i.e. they do not need to be supplied again to update.

Usage

## S3 method for class 'safs'
update(object, iter, x, y, ...)

Arguments

object

An object produced by gafs or safs

iter

a single numeric integer

x, y

the original training data used in the call to gafs or safs. Only required for non-recipe methods.

...

not currently used

Value

an object of class gafs or safs

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_search2 <- update(rf_search,
	                 iter = 1,
	                 x = train_data[, -ncol(train_data)],
                     y = train_data$Class)
rf_search2

## 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.