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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lattice.train.R
\name{histogram.train}
\alias{histogram.train}
\alias{stripplot.train}
\alias{xyplot.train}
\alias{densityplot.train}
\title{Lattice functions for plotting resampling results}
\usage{
\method{histogram}{train}(x, data = NULL, metric = x$metric, ...)
}
\arguments{
\item{x}{An object produced by \code{\link{train}}}
\item{data}{This argument is not used}
\item{metric}{A character string specifying the single performance metric
that will be plotted}
\item{\dots}{arguments to pass to either
\code{\link[lattice:histogram]{histogram}},
\code{\link[lattice:histogram]{densityplot}},
\code{\link[lattice:xyplot]{xyplot}} or
\code{\link[lattice:xyplot]{stripplot}}}
}
\value{
A lattice plot object
}
\description{
A set of lattice functions are provided to plot the resampled performance
estimates (e.g. classification accuracy, RMSE) over tuning parameters (if
any).
}
\details{
By default, only the resampling results for the optimal model are saved in
the \code{train} object. The function \code{\link{trainControl}} can be used
to save all the results (see the example below).
If leave-one-out or out-of-bag resampling was specified, plots cannot be
produced (see the \code{method} argument of \code{\link{trainControl}})
For \code{xyplot} and \code{stripplot}, the tuning parameter with the most
unique values will be plotted on the x-axis. The remaining parameters (if
any) will be used as conditioning variables. For \code{densityplot} and
\code{histogram}, all tuning parameters are used for conditioning.
Using \code{horizontal = FALSE} in \code{stripplot} works.
}
\examples{
\dontrun{
library(mlbench)
data(BostonHousing)
library(rpart)
rpartFit <- train(medv ~ .,
data = BostonHousing,
"rpart",
tuneLength = 9,
trControl = trainControl(
method = "boot",
returnResamp = "all"))
densityplot(rpartFit,
adjust = 1.25)
xyplot(rpartFit,
metric = "Rsquared",
type = c("p", "a"))
stripplot(rpartFit,
horizontal = FALSE,
jitter = TRUE)
}
}
\seealso{
\code{\link{train}}, \code{\link{trainControl}},
\code{\link[lattice:histogram]{histogram}},
\code{\link[lattice:histogram]{densityplot}},
\code{\link[lattice:xyplot]{xyplot}},
\code{\link[lattice:xyplot]{stripplot}}
}
\author{
Max Kuhn
}
\keyword{hplot}
|