oscar.sparsify | R Documentation |
Variable estimates (rows) as a function of cardinality (k, columns). Since a model can drop out variables in favor of two better ones as k increases, this sparse representation helps visualize which variables are included at what cardinality.
oscar.sparsify(fit, kmax = fit@kmax)
fit |
oscar-model object |
kmax |
Create matrix until kmax-value; by default same as for fit object, but for high dimensional tasks one may wish to reduce this |
Uses sparseMatrix-class from Matrix-package
A sparse matrix of variables (rows) as a function of cardinality k (columns), where elements are the beta estimates.
if(interactive()){
data(ex)
fit <- oscar(x=ex_X, y=ex_Y, k=ex_K, w=ex_c, family='cox')
oscar.sparsify(fit, kmax=5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.