View source: R/plot.glmnetcr.R
plot.glmnetcr | R Documentation |
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
.
## 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, ...)
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 |
This function was adapted from the glmpath package by Park and Hastie for a glmnetcr
object.
Kellie J. Archer archer.43@osu.edu
See also glmnetcr
, predict.glmnetcr
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.