screen_glmnet {spareg} | R Documentation |
Screening coefficient based on glmnet coefficients
Description
Creates an object class 'screencoef'
using arguments passed by user,
where the screening coefficient should be computed based on penalized coefficients.
Usage
screen_glmnet(..., control = list())
Arguments
... |
includes arguments which can be passed as attributes to the
|
control |
list of controls to be passed to the screening function |
Details
Creates an object class 'screencoef'
using arguments passed by user.
The function generate_fun
relies on glmnet.
Arguments related to the screening procedure can
be passed to the screen_glmnet()
function through ...
, and
will be saved as attributes of the 'screencoef'
object.
The following attributes are relevant for spar and spar.cv:
-
nscreen
integer giving the number of variables to be retained after screening; if not specified, defaults to $2n$. -
split_data_prop
, double between 0 and 1 which indicates the proportion of the data that should be used for computing the screening coefficient. The remaining data will be used for estimating the marginal models in the SPAR algorithm; if not specified, the whole data will be used for estimating the screening coefficient and the marginal models. -
type
character - either"prob"
(indicating that probabilistic screening should be employed) or"fixed"
(indicating that a fixed set ofnscreen
variables should be employed across the ensemble); defaults totype = "prob"
. -
reuse_in_rp
logical - indicates whether the screening coefficient should be reused at a later stage in the construction of the random projection. Defaults toFALSE
.
Value
object of class 'screencoef'
which is a list with elements
-
name
(character) -
control
(list of controls passed as an argument) -
generate_fun
for generating the screening coefficient. This function should have arguments andy
(vector of (standardized for Gaussian) responses),x
(the matrix of standardized predictors) and a'screencoef'
object.
Examples
example_data <- simulate_spareg_data(n = 200, p = 2000, ntest = 100)
spar_res <- spar(example_data$x, example_data$y, xval = example_data$xtest,
yval = example_data$ytest, nummods=c(5, 10, 15, 20, 25, 30),
screencoef = screen_glmnet(control = list(alpha = 0.1)))