plot.glmnetcr {glmnetcr} | R Documentation |
Plots the Regularization Path Computed
Description
This function takes a glmnetcr
object and visualizes the regularization path. The horizontal axis can be norm
, lambda
or step
. The vertical axis can be coefficients
, aic
or bic
.
Usage
## S3 method for class 'glmnetcr'
plot(x, xvar = c("norm", "lambda", "step"),
type = c("coefficients", "aic", "bic"), omit.zero = TRUE, breaks = TRUE, mar = NULL,
eps = .Machine$double.eps, main = NULL, ...)
Arguments
x |
a |
xvar |
horizontal axis. |
type |
type of the plot, or the vertical axis. Default is "coefficients". |
omit.zero |
If |
breaks |
If |
mar |
margin relative to the current font size |
eps |
an effective zero |
main |
title of the plot |
... |
other options for the plot |
Note
This function was adapted from the glmpath package by Park and Hastie for a glmnetcr
object.
Author(s)
Kellie J. Archer archer.43@osu.edu
See Also
See also glmnetcr
, predict.glmnetcr
Examples
library(glmnetcr)
data(diabetes)
x<-diabetes[,2:dim(diabetes)[2]]
y<-diabetes$y
summary(y)
fit<-glmnetcr(x,y)
plot(fit)
plot(fit,xvar="step",type="bic")