plot.cva.glmnet {nestedcv} | R Documentation |
Plot lambda across range of alphas
Description
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.
Usage
## S3 method for class 'cva.glmnet'
plot(
x,
xaxis = c("lambda", "alpha", "nvar"),
errorBar = (xaxis == "alpha"),
errorWidth = 0.015,
min.pch = NULL,
scheme = NULL,
palette = "zissou",
showLegend = "bottomright",
...
)
Arguments
x |
Object of class 'cva.glmnet'. |
xaxis |
String specifying what is plotted on the x axis, either log lambda, alpha or the number of non-zero coefficients. |
errorBar |
Logical whether to control error bars for the standard
deviation of model deviance when |
errorWidth |
Width of error bars. |
min.pch |
Plotting 'character' for the minimum point of each curve. Not
shown if set to |
scheme |
Colour scheme. Overrides the |
palette |
Palette name (one of |
showLegend |
Either a keyword to position the legend or |
... |
Other arguments passed to plot. Use |
Value
No return value
Author(s)
Myles Lewis