densityplot.rfe

0th

Percentile

Lattice functions for plotting resampling results of recursive feature selection

A set of lattice functions are provided to plot the resampled performance estimates (e.g. classification accuracy, RMSE) over different subset sizes.

Keywords
hplot
Usage
# S3 method for rfe
densityplot(x, data = NULL, metric = x$metric, ...)
Arguments
x

An object produced by rfe

data

This argument is not used

metric

A character string specifying the single performance metric that will be plotted

arguments to pass to either histogram, densityplot, xyplot or stripplot

Details

By default, only the resampling results for the optimal model are saved in the rfe object. The function rfeControl can be used to save all the results using the returnResamp argument.

If leave-one-out or out-of-bag resampling was specified, plots cannot be produced (see the method argument of rfeControl)

Value

A lattice plot object

See Also

rfe, rfeControl, histogram, densityplot, xyplot, stripplot

Aliases
  • densityplot.rfe
  • xyplot.rfe
  • stripplot.rfe
  • histogram.rfe
Examples
# NOT RUN {
# }
# NOT RUN {
library(mlbench)
n <- 100
p <- 40
sigma <- 1
set.seed(1)
sim <- mlbench.friedman1(n, sd = sigma)
x <- cbind(sim$x,  matrix(rnorm(n * p), nrow = n))
y <- sim$y
colnames(x) <- paste("var", 1:ncol(x), sep = "")

normalization <- preProcess(x)
x <- predict(normalization, x)
x <- as.data.frame(x)
subsets <- c(10, 15, 20, 25)

ctrl <- rfeControl(
                   functions = lmFuncs,
                   method = "cv",
                   verbose = FALSE,
                   returnResamp = "all")

lmProfile <- rfe(x, y,
                 sizes = subsets,
                 rfeControl = ctrl)
xyplot(lmProfile)
stripplot(lmProfile)

histogram(lmProfile)
densityplot(lmProfile)
# }
# NOT RUN {
# }
Documentation reproduced from package caret, version 6.0-84, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.