This function fits an OSCAR model object to the provided training data with the desired model family.
oscar(
x,
y,
k,
w,
family = "cox",
metric,
solver = 1,
verb = 1,
print = 3,
kmax,
sanitize = TRUE,
percentage = 1,
in_selection = 1,
storeX = TRUE,
storeY = TRUE,
control,
...
)Fitted oscar-object
Data matrix 'x'
Response vector/two-column matrix 'y' (see: family); number of rows equal to nrow(x)
Integer (0/1) kit indicator matrix; number of columns equal to ncol(x), Default: Unit diagonal indicator matrix
Kit cost weight vector w of length nrow(k), Default: Equal cost for all variables
Model family, should be one of: 'cox', 'mse'/'gaussian', or 'logistic, Default: 'cox'
Goodness metric, Default(s): Concordance index for Cox, MSE for Gaussian, and AUC for logistic regression
Solver used in the optimization, should be 1/'DBDC' or 2/'LMBM', Default: 1.
Level of verbosity in R, Default: 1
Level of verbosity in Fortran (may not be visible on all terminals); should be an integer between range, range, Default: 3
Maximum k step tested, by default all k are tested from k to maximum dimensionality, Default: ncol(x)
Whether input column names should be cleaned of potentially problematic symbols, Default: TRUE
Percentage of possible starting points used within range [0,1], Default: 1
Which starting point selection strategy is used (1, 2 or 3), Default: 1
If data matrix X should be saved in the model object; turning this off might would help with memory, Default: TRUE
If data response Y should be saved in the model object; turning this off might would help with memory, Default: TRUE
Tuning parameters for the optimizers, see function oscar.control(), Default: see ?oscar.control
Additional parameters
OSCAR utilizes the L0-pseudonorm, also known as the best subset selection, and makes use of a DC-formulation of the discrete feature selection task into a continuous one. Then an appropriate optimization algorithm is utilized to find optima at different cardinalities (k). The S4 model objects 'oscar' can then be passed on to various down-stream functions, such as oscar.pareto, oscar.cv, and oscar.bs, along with their supporting visualization functions.
oscar.cv oscar.bs oscar.pareto oscar.visu oscar.cv.visu oscar.bs.visu oscar.pareto.visu oscar.binplot
if(interactive()){
data(ex)
fit <- oscar(x=ex_X, y=ex_Y, k=ex_K, w=ex_c, family='cox')
fit
}
Run the code above in your browser using DataLab