
Last chance! 50% off unlimited learning
Sale ends in
"glmnet"
object.
"plot"(x, xvar = c("norm", "lambda", "dev"), label = FALSE, ...)
"plot"(x, xvar = c("norm", "lambda", "dev"), label = FALSE,type.coef=c("coef","2norm"), ...)
"plot"(x, xvar = c("norm", "lambda", "dev"), label = FALSE,type.coef=c("coef","2norm"), ...)
"glmnet"
model"norm"
plots against the
L1-norm of the coefficients, "lambda"
against the log-lambda
sequence, and "dev"
against the percent deviance explained.TRUE
, label the curves with variable sequence
numbers.type.coef="2norm"
then a single curve per variable,
else if type.coef="coef"
, a coefficient plot per responsex
is a multinomial
model, a coefficient plot is produced for each class.
glmnet
, and print
, predict
and coef
methods.x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
g2=sample(1:2,100,replace=TRUE)
g4=sample(1:4,100,replace=TRUE)
fit1=glmnet(x,y)
plot(fit1)
plot(fit1,xvar="lambda",label=TRUE)
fit3=glmnet(x,g4,family="multinomial")
plot(fit3,pch=19)
Run the code above in your browser using DataLab