summary.flam {flam} | R Documentation |
flam
This function summarizes a call to flam
, as well as the sparsity pattern of the resulting feature estimates for a single or all fits.
## S3 method for class 'flam' summary(object, index = NULL, ...) ## S3 method for class 'flamSparsity' plot(x, ...)
object |
an object of class "flam". |
index |
the index for the fit of interest to be summarized. Note that |
x |
an object of class 'flamSparsity', which is silently returned by |
... |
additional arguments to be passed. These are ignored in this function. |
If index
is not specified, summary.flam
silently returns the sparsity matrix and tuning parameters in an object of class 'flamSparsity'. This is used when plot(summary(object))
is called.
Ashley Petersen
Petersen, A., Witten, D., and Simon, N. (2014). Fused Lasso Additive Model. arXiv preprint arXiv:1409.5391.
#See ?'flam-package' for a full example of how to use this package #generate data set.seed(1) data <- sim.data(n = 50, scenario = 1, zerof = 10, noise = 1) #fit model for a range of tuning parameters flam.out <- flam(x = data$x, y = data$y, alpha.seq = c(0.8, 0.9, 1)) #summarize all of the fits (in particular, the percent sparsity achieved) #note: percent sparsity is the percentage of features estimated to have #no relationship with outcome summary(flam.out) #the percent sparsity over the range of tuning parameters can also #be displayed in a plot plot(summary(flam.out)) #we can also summarize the fit with a specific index, e.g. 25 #that is, lambda and alpha of flam.out$all.lambda[25]; flam.out$all.alpha[25] summary(flam.out, index = 25)