Description Usage Arguments Examples
Take a glmnet object and plot out the path of the coefficient for each variable as model complexity increases.
1 2 3 4 |
glmnet |
a glmet object from |
labelLambda |
label all variables that are not 0 at this the closest lambda <= labelLambda |
ylab |
label for y axis |
transformFunc |
a functions to adjust y-axis labels (e.g. |
minBeta |
the minimum absolute necessary to count beta as different from zero |
xlim |
minimum and maximum for limits of the x axis. Leave empty to set automatically |
ylim |
minimum and maximum for limits of the y axis. Leave empty to set automatically |
... |
additional arguments for |
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)
plotBetas(cvob1$glmnet.fit,cvob1$lambda.1se)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.