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

plot.gafs

Plot Method for the gafs and safs Classes


Description

Plot the performance values versus search iteration

Usage

## S3 method for class 'gafs'
plot(
  x,
  metric = x$control$metric["external"],
  estimate = c("internal", "external"),
  output = "ggplot",
  ...
)

## S3 method for class 'gafs'
ggplot(data = NULL, mapping = NULL, ..., environment = NULL)

## S3 method for class 'safs'
ggplot(data = NULL, mapping = NULL, ..., environment = NULL)

Arguments

x

an object of class gafs or safs

metric

the measure of performance to plot (e.g. RMSE, accuracy, etc)

estimate

the type of estimate: either "internal" or "external"

output

either "data", "ggplot" or "lattice"

...

For plot methods, these are options passed to xyplot. For ggplot methods, they are not used.

data, mapping, environment

kept for consistency with ggplot and are not used here.

Details

The mean (averaged over the resamples) is plotted against the search iteration using a scatter plot.

When output = "data", the unaveraged data are returned with columns for all the performance metrics and the resample indicator.

Value

Either a data frame, ggplot object or lattice object

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 = 50,
                  safsControl = ctrl)

plot(rf_search)
plot(rf_search,
	 output = "lattice",
	 auto.key = list(columns = 2))

plot_data <- plot(rf_search, output = "data")
summary(plot_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.