screen.wgtd.elasticnet: Weighted regularized regression screening algorithm

screen.wgtd.elasticnetR Documentation

Weighted regularized regression screening algorithm

Description

Performs feature selection via cv.glmnet.

Usage

screen.wgtd.elasticnet(
  Y,
  X,
  family,
  obsWeights,
  id,
  alpha = 0.5,
  k = 2,
  nfolds = 10,
  nlambda = 100,
  ...
)

screen.wgtd.lasso(..., alpha = 1)

Arguments

Y

Outcome (numeric vector). See SuperLearner for specifics.

X

Predictor variable(s) (data.frame or matrix). See SuperLearner for specifics.

family

Error distribution to be used in the model: gaussian or binomial. See SuperLearner for specifics.

obsWeights

Optional numeric vector of observation weights. See SuperLearner for specifics.

id

Cluster identification variable. Currently unused.

alpha

The elasticnet mixing parameter. Default for screen.wgtd.elasticnet is (arbitrarily) 0.5. Forced to 1 for screen.wgtd.lasso. See glmnet for specifics.

k

Minimum number of features to select. Only used if fewer than this number of features are selected using the optimal lambda value chosen via cross-validation.

nfolds

Number of cross-validation folds to use when choosing optimal lambda. Default is 10. See cv.glmnet for specifics.

nlambda

Number of lambda values to try. Default is 100. See glmnet for specifics.

...

Currently unused.

Value

A logical vector with length equal to ncol(X)

Examples

# based on example in SuperLearner package
set.seed(1)
n <- 100
p <- 20
X <- matrix(rnorm(n*p), nrow = n, ncol = p)
X <- data.frame(X)
Y <- X[, 1] + sqrt(abs(X[, 2] * X[, 3])) + X[, 2] - X[, 3] + rnorm(n)
obsWeights <- 1/runif(n)
screen.wgtd.elasticnet(Y, X, gaussian(), obsWeights, seq(n), k = 3)
screen.wgtd.lasso(Y, X, gaussian(), obsWeights, seq(n), k = 3)

saraemoore/SLScreenExtra documentation built on Nov. 4, 2023, 9:31 p.m.