plotGlmnet: Plot model performance from cv.glmnet

Description Usage Arguments Examples

View source: R/plotGlmnet.R

Description

Take a cv.glmnet object and plot out the change in performance as model complexity increases

Usage

1
plotGlmnet(fit, markBest1SE = FALSE, ...)

Arguments

fit

a cv.glmet object from cv.glmnet

markBest1SE

add a vertical line through the least complex model within 1 standard error of the best model

...

extra arguments to plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#example from cv.glmet
set.seed(1010)
n=1000;p=100
nzc=trunc(p/10)
x=matrix(rnorm(n*p),n,p)
beta=rnorm(nzc)
fx= x[,seq(nzc)] %*% beta
eps=rnorm(n)*5
y=drop(fx+eps)
px=exp(fx)
px=px/(1+px)
ly=rbinom(n=length(px),prob=px,size=1)
set.seed(1011)
cvob1=glmnet::cv.glmnet(x,y)
plotGlmnet(cvob1)

sherrillmix/glmnetPlotR documentation built on May 29, 2019, 9:24 p.m.