plot.plasso | R Documentation |
Plot coefficient paths of (Post-) Lasso model.
## S3 method for class 'plasso'
plot(x, ..., lasso = FALSE, xvar = c("norm", "lambda", "dev"), label = FALSE)
x |
|
... |
Pass generic |
lasso |
If set as True, coefficient paths for Lasso instead of Post-Lasso is plotted. Default is False. |
xvar |
X-axis variable:
|
label |
If TRUE, label the curves with variable sequence numbers |
Produces a coefficient profile plot of the coefficient paths for a fitted plasso
object.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.