File: xyplot.resamples.Rd

package info (click to toggle)
r-cran-caret 7.0-1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,036 kB
  • sloc: ansic: 210; sh: 10; makefile: 2
file content (169 lines) | stat: -rw-r--r-- 4,779 bytes parent folder | download | duplicates (3)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/resamples.R
\name{xyplot.resamples}
\alias{xyplot.resamples}
\alias{densityplot.resamples}
\alias{bwplot.resamples}
\alias{splom.resamples}
\alias{parallelplot.resamples}
\alias{dotplot.resamples}
\alias{ggplot.resamples}
\title{Lattice Functions for Visualizing Resampling Results}
\usage{
\method{xyplot}{resamples}(
  x,
  data = NULL,
  what = "scatter",
  models = NULL,
  metric = x$metric[1],
  units = "min",
  ...
)

\method{parallelplot}{resamples}(x, data = NULL, models = x$models, metric = x$metric[1], ...)

\method{splom}{resamples}(
  x,
  data = NULL,
  variables = "models",
  models = x$models,
  metric = NULL,
  panelRange = NULL,
  ...
)

\method{densityplot}{resamples}(x, data = NULL, models = x$models, metric = x$metric, ...)

\method{bwplot}{resamples}(x, data = NULL, models = x$models, metric = x$metric, ...)

\method{dotplot}{resamples}(
  x,
  data = NULL,
  models = x$models,
  metric = x$metric,
  conf.level = 0.95,
  ...
)

\method{ggplot}{resamples}(
  data = NULL,
  mapping = NULL,
  environment = NULL,
  models = data$models,
  metric = data$metric[1],
  conf.level = 0.95,
  ...
)
}
\arguments{
\item{x}{an object generated by \code{resamples}}

\item{data}{Only used for the \code{ggplot} method; an object generated by
\code{resamples}}

\item{what}{for \code{xyplot}, the type of plot. Valid options are:
"scatter" (for a plot of the resampled results between two models),
"BlandAltman" (a Bland-Altman, aka MA plot between two models), "tTime" (for
the total time to run \code{train} versus the metric), "mTime" (for the time
to build the final model) or "pTime" (the time to predict samples - see the
\code{timingSamps} options in \code{\link{trainControl}},
\code{\link{rfeControl}}, or \code{\link{sbfControl}})}

\item{models}{a character string for which models to plot. Note:
\code{xyplot} requires one or two models whereas the other methods can plot
more than two.}

\item{metric}{a character string for which metrics to use as conditioning
variables in the plot. \code{splom} requires exactly one metric when
\code{variables = "models"} and at least two when \code{variables =
"metrics"}.}

\item{units}{either "sec", "min" or "hour"; which \code{what} is either
"tTime", "mTime" or "pTime", how should the timings be scaled?}

\item{\dots}{further arguments to pass to either
\code{\link[lattice:histogram]{histogram}},
\code{\link[lattice:histogram]{densityplot}},
\code{\link[lattice:xyplot]{xyplot}}, \code{\link[lattice:xyplot]{dotplot}}
or \code{\link[lattice:splom]{splom}}}

\item{variables}{either "models" or "metrics"; which variable should be
treated as the scatter plot variables?}

\item{panelRange}{a common range for the panels. If \code{NULL}, the panel
ranges are derived from the values across all the models}

\item{conf.level}{the confidence level for intervals about the mean
(obtained using \code{\link[stats]{t.test}})}

\item{mapping, environment}{Not used.}
}
\value{
a lattice object
}
\description{
Lattice and ggplot functions for visualizing resampling results across models
}
\details{
The ideas and methods here are based on Hothorn et al. (2005) and Eugster et
al. (2008).

\code{dotplot} and \code{ggplot} plots the average performance value (with two-sided
confidence limits) for each model and metric.

\code{densityplot} and \code{bwplot} display univariate visualizations of
the resampling distributions while \code{splom} shows the pair-wise
relationships.
}
\examples{

\dontrun{
#load(url("http://topepo.github.io/caret/exampleModels.RData"))

resamps <- resamples(list(CART = rpartFit,
                          CondInfTree = ctreeFit,
                          MARS = earthFit))

dotplot(resamps,
        scales =list(x = list(relation = "free")),
        between = list(x = 2))

bwplot(resamps,
       metric = "RMSE")

densityplot(resamps,
            auto.key = list(columns = 3),
            pch = "|")

xyplot(resamps,
       models = c("CART", "MARS"),
       metric = "RMSE")

splom(resamps, metric = "RMSE")
splom(resamps, variables = "metrics")

parallelplot(resamps, metric = "RMSE")


}

}
\references{
Hothorn et al. The design and analysis of benchmark experiments.
Journal of Computational and Graphical Statistics (2005) vol. 14 (3) pp.
675-699

Eugster et al. Exploratory and inferential analysis of benchmark
experiments. Ludwigs-Maximilians-Universitat Munchen, Department of
Statistics, Tech. Rep (2008) vol. 30
}
\seealso{
\code{\link{resamples}}, \code{\link[lattice:xyplot]{dotplot}},
\code{\link[lattice:bwplot]{bwplot}},
\code{\link[lattice:histogram]{densityplot}},
\code{\link[lattice:xyplot]{xyplot}}, \code{\link[lattice:splom]{splom}}
}
\author{
Max Kuhn
}
\keyword{hplot}