Description Usage Arguments Details Value Author(s) See Also Examples
A set of lattice functions are provided to plot the resampled performance estimates (e.g. classification accuracy, RMSE) over different subset sizes.
1 2 3 4 5 6 7 8 9 10 11 | ## S3 method for class 'rfe'
histogram(x, data = NULL, metric = x$metric, ...)
## S3 method for class 'rfe'
densityplot(x, data = NULL, metric = x$metric, ...)
## S3 method for class 'rfe'
xyplot(x, data = NULL, metric = x$metric, ...)
## S3 method for class 'rfe'
stripplot(x, data = NULL, metric = x$metric, ...)
|
x |
An object produced by |
data |
This argument is not used |
metric |
A character string specifying the single performance metric that will be plotted |
... |
arguments to pass to either |
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
)
A lattice plot object
Max Kuhn
rfe
, rfeControl
, histogram
, densityplot
, xyplot
, stripplot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## 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)
## End(Not run)
|
Loading required package: lattice
Loading required package: ggplot2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.