Different types of plot showing cross-validated tuning of alpha and lambda
from elastic net regression via glmnet::glmnet. If xaxis is set to
"lambda", log lambda is on the x axis while the tuning metric (log loss,
deviance, accuracy, AUC etc) is on the y axis. Multiple alpha values are
shown by different colours. If xaxis is set to "alpha", alpha is on the x
axis with the tuning metric on y, with error bars showing metric SD. if
xaxis is set to "nvar" the number of non-zero coefficients is shown on x
and how this relates to model deviance/ accuracy on y.
# S3 method for cva.glmnet
plot(
x,
xaxis = c("lambda", "alpha", "nvar"),
errorBar = (xaxis == "alpha"),
errorWidth = 0.015,
min.pch = NULL,
scheme = NULL,
palette = "zissou",
showLegend = "bottomright",
...
)No return value
Object of class 'cva.glmnet'.
String specifying what is plotted on the x axis, either log lambda, alpha or the number of non-zero coefficients.
Logical whether to control error bars for the standard
deviation of model deviance when xaxis = 'lambda'. Because of overlapping
lines, only the deviance of the top and bottom points at a given lambda are
shown.
Width of error bars.
Plotting 'character' for the minimum point of each curve. Not
shown if set to NULL. See points.
Colour scheme. Overrides the palette argument.
Palette name (one of hcl.pals()) which is passed to
hcl.colors.
Either a keyword to position the legend or NULL to hide
the legend.
Other arguments passed to plot. Use type = 'p' to plot a
scatter plot instead of a line plot.
Myles Lewis
nestcv.glmnet