Plot hyperparameter validation path. Automated plotting method for
HyperParsEffectData
object. Useful for determining the importance
or effect of a particular hyperparameter on some performance measure and/or
optimizer.
Usage
plotHyperParsEffect(
hyperpars.effect.data,
x = NULL,
y = NULL,
z = NULL,
plot.type = "scatter",
loess.smooth = FALSE,
facet = NULL,
global.only = TRUE,
interpolate = NULL,
show.experiments = FALSE,
show.interpolated = FALSE,
nested.agg = mean,
partial.dep.learn = NULL
)
Arguments
- hyperpars.effect.data
(
HyperParsEffectData
)
Result of generateHyperParsEffectData- x
(
character(1)
)
Specify what should be plotted on the x axis. Must be a column fromHyperParsEffectData$data
. For partial dependence, this is assumed to be a hyperparameter.- y
(
character(1)
)
Specify what should be plotted on the y axis. Must be a column fromHyperParsEffectData$data
- z
(
character(1)
)
Specify what should be used as the extra axis for a particular geom. This could be for the fill on a heatmap or color aesthetic for a line. Must be a column fromHyperParsEffectData$data
. Default isNULL
.- plot.type
(
character(1)
)
Specify the type of plot: “scatter” for a scatterplot, “heatmap” for a heatmap, “line” for a scatterplot with a connecting line, or “contour” for a contour plot layered ontop of a heatmap. Default is “scatter”.- loess.smooth
(
logical(1)
)
IfTRUE
, will add loess smoothing line to plots where possible. Note that this is probably only useful whenplot.type
is set to either “scatter” or “line”. Must be a column fromHyperParsEffectData$data
. Not used with partial dependence. Default isFALSE
.- facet
(
character(1)
)
Specify what should be used as the facet axis for a particular geom. When using nested cross validation, set this to “nested_cv_run” to obtain a facet for each outer loop. Must be a column fromHyperParsEffectData$data
. Please note that facetting is not supported with partial dependence plots! Default isNULL
.- global.only
(
logical(1)
)
IfTRUE
, will only plot the current global optima when setting x = "iteration" and y as a performance measure fromHyperParsEffectData$measures
. Set this to FALSE to always plot the performance of every iteration, even if it is not an improvement. Not used with partial dependence. Default isTRUE
.- interpolate
(Learner |
character(1)
)
If notNULL
, will interpolate non-complete grids in order to visualize a more complete path. Only meaningful when attempting to plot a heatmap or contour. This will fill in “empty” cells in the heatmap or contour plot. Note that cases of irregular hyperparameter paths, you will most likely need to use this to have a meaningful visualization. Accepts either a regression Learner object or the learner as a string for interpolation. This cannot be used with partial dependence. Default isNULL
.- show.experiments
(
logical(1)
)
IfTRUE
, will overlay the plot with points indicating where an experiment ran. This is only useful when creating a heatmap or contour plot with interpolation so that you can see which points were actually on the original path. Note: if any learner crashes occurred within the path, this will becomeTRUE
. Not used with partial dependence. Default isFALSE
.- show.interpolated
(
logical(1)
)
IfTRUE
, will overlay the plot with points indicating where interpolation ran. This is only useful when creating a heatmap or contour plot with interpolation so that you can see which points were interpolated. Not used with partial dependence. Default isFALSE
.- nested.agg
(
function
)
The function used to aggregate nested cross validation runs when plotting 2 hyperparameters. This is also used for nested aggregation in partial dependence. Default ismean
.- partial.dep.learn
(Learner |
character(1)
)
The regression learner used to learn partial dependence. Must be specified if “partial.dep” is set toTRUE
in generateHyperParsEffectData. Accepts either a Learner object or the learner as a string for learning partial dependence. Default isNULL
.
Note
Any NAs incurred from learning algorithm crashes will be indicated in
the plot (except in the case of partial dependence) and the NA values will be
replaced with the column min/max depending on the optimal values for the
respective measure. Execution time will be replaced with the max.
Interpolation by its nature will result in predicted values for the
performance measure. Use interpolation with caution. If “partial.dep”
is set to TRUE
in generateHyperParsEffectData, only
partial dependence will be plotted.
Since a ggplot2 plot object is returned, the user can change the axis labels and other aspects of the plot using the appropriate ggplot2 syntax.