https://github.com/cran/caret
Raw File
Tip revision: 4cad16da168d40829599b6018fe9e820b2e3a5d9 authored by Max Kuhn on 07 December 2011, 10:13:55 UTC
version 5.09-006
Tip revision: 4cad16d
plot.train.Rd
\name{plot.train}
\alias{plot.train}
\title{Plot Method for the train Class}
\description{
  This function takes the output of a \code{\link{train}} object and creates
      a line or level plot using the \code{lattice} library.
}
\usage{
\method{plot}{train}(x, 
     plotType = "scatter",
     metric = x$perfNames[1],
     digits = getOption("digits") - 3, 
     xTrans = NULL, 
     ...)
}
\arguments{
  \item{x}{an object of class \code{\link{train}}.}
  \item{metric}{What measure of performance to plot. Examples of possible values are "RMSE", "Rsquared", "Accuracy" or "Kappa". Other values can be used depending n what metrics have been calculated.}
  \item{plotType}{a string describing the type of plot (\code{"scatter"}, \code{"level"} or \code{"line"})}
  \item{digits}{an integer specifying the number of significant digits used to label the parameter value.}
  \item{xTrans}{a fuction that will be used to scale the x-axis in scatter plots.}
  \item{\dots}{specifications to be passed to \code{\link[lattice]{levelplot}}, \code{\link[lattice]{xyplot}}, \code{\link[lattice:xyplot]{stripplot}} (for line plots). The function automatically sets some arguments (e.g. axis labels) but passing in values here will over-ride the defaults }
}
\details{
If there are no tuning parameters, or none were varied, an error is produced.
  
If the model has one tuning parameter with multiple candidate values, a
plot is produced showing the profile of the results over the
parameter. Also, a plot can be produced if there are multiple
tuning parameters but only one is varied.

If there are two tuning parameters with different values, a 
plot can be produced where a different line is shown for each value of
of the other parameter. For three parameters, the same line plot is
created within conditioning panels of the other parameter.

Also, with two tuning parameters (with different values), a levelplot
(i.e. un-clustered heatmap) can be created. For more than two
parameters, this plot is created inside conditioning panels.

  
}
\author{Max Kuhn}

\references{Kuhn (2008), ``Building Predictive Models in R Using the caret'' (\url{http://www.jstatsoft.org/v28/i05/})}

\seealso{ \code{\link{train}}, \code{\link[lattice]{levelplot}}, \code{\link[lattice]{xyplot}}, \code{\link[lattice:xyplot]{stripplot}} }
\examples{

pamFit <- train(Species ~ .,
                  data = iris, 
                  "pam", 
                  tuneLength = 15)
plot(pamFit, scales = list(x = list(rot = 90)))

library(klaR)
rdaFit <- train(Species ~ .,
                data = iris, 
                "rda", 
                control = trainControl(method = "cv"))
plot(rdaFit, plotType = "line")
plot(rdaFit, plotType = "level")
 }
   
\keyword{hplot} 
back to top