train
object and creates
a line or level plot using the lattice or ggplot2 libraries.
"plot"(x, plotType = "scatter", metric = x$metric[1], digits = getOption("digits") - 3, xTrans = NULL, nameInStrip = FALSE, ...)
"ggplot"(data = NULL, mapping = NULL, metric = data$metric[1], plotType = "scatter", output = "layered", nameInStrip = FALSE, highlight = FALSE, ..., environment = NULL)
train
."scatter"
, "level"
or "line"
(plot
only))train
.ggplot
object with no layers. The third value returns a plot with a set of layers. TRUE
, a diamond is placed around the optimal parameter setting for models using grid search.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/facets 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/facets.
train
, levelplot
, xyplot
, stripplot
, ggplot
## Not run:
# library(klaR)
# rdaFit <- train(Species ~ .,
# data = iris,
# method = "rda",
# control = trainControl(method = "cv"))
# plot(rdaFit)
# plot(rdaFit, plotType = "level")
#
# ggplot(rdaFit) + theme_bw()
#
# ## End(Not run)
Run the code above in your browser using DataLab