oscar.binarize {oscar} | R Documentation |
Binary logical indicator matrix representation of an oscar object's coefficients (zero vs. non-zero, i.e. feature inclusion)
Description
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)
Usage
oscar.binarize(fit, kmax = fit@kmax)
Arguments
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 |
Details
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.
Value
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.
Examples
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)
}
[Package oscar version 1.2.1 Index]