plot.plasso {plasso}R Documentation

Plot coefficient paths

Description

Plot coefficient paths of (Post-) Lasso model.

Usage

## S3 method for class 'plasso'
plot(x, ..., lasso = FALSE, xvar = c("norm", "lambda", "dev"), label = FALSE)

Arguments

x

plasso object

...

Pass generic plot options

lasso

If set as True, coefficient paths for Lasso instead of Post-Lasso is plotted. Default is False.

xvar

X-axis variable: norm plots against the L1-norm of the coefficients, lambda against the log-lambda sequence, and dev against the percent deviance explained.

label

If TRUE, label the curves with variable sequence numbers

Value

Produces a coefficient profile plot of the coefficient paths for a fitted plasso object.

Examples

# load toeplitz data
data(toeplitz)
# extract target and features from data
y = as.matrix(toeplitz[,1])
X = toeplitz[,-1]
# fit plasso to the data
p = plasso::plasso(X,y)
# plot coefficient paths for Post-Lasso model
plot(p, lasso=FALSE, xvar="lambda")
# plot coefficient paths for Lasso model
plot(p, lasso=TRUE, xvar="lambda")


[Package plasso version 0.1.2 Index]