oscar.binarize | R Documentation |
Create a sparse matrix with binary indicator 1 indicating that a coefficient was non-zero, and value 0 (or . in sparse matrix) indicating that a coefficient was zero (i.e. feature not included)
oscar.binarize(fit, kmax = fit@kmax)
fit |
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 |
The matrix consists of TRUE/FALSE values, and is very similar to the oscar.sparsify, where the function provides estimate values in a sparse matrix format.
A binary logical indicator matrix of variables (rows) as a function of cardinality k (columns), where elements are binary indicators for 1 as non-zero and 0 as zero.
if(interactive()){
data(ex)
fit <- oscar(x=ex_X, y=ex_Y, k=ex_K, w=ex_c, family='cox')
oscar.binarize(fit, kmax=5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.