screen.glmnet.fix: Lasso screener selects pre-specified variables

Description Usage Arguments See Also Examples

View source: R/specify_variables.R

Description

Lasso screener for SuperLearner() that always retains specified variables and passes approximately nVar variables to SuperLearner(). When the number of non-zero coefficients exceeds nVar, a larger value of the regularization parameter lambda is chosen to select a smaller set of variables that excludes the ties.

Usage

1
2
screen.glmnet.fix(Y, X, family, alpha = 1, minscreen = 2, nVar = 10,
  nfolds = 10, nlambda = 100, fixed.var.index = var.index, ...)

Arguments

Y

outcome variable (specified in SuperLearner())

X

data frame

nVar

number of non-zero variables to be selected

var.index

indices of variables to always be included by the screener

See Also

See glmnet for additional details on implementing lasso

Examples

1
2
3
4
If you do not know the indices of the variables you always want to include, 
  you can get them from the variable name, where newdat is the dataframe: 
  var.index <- c(which(colnames(newdat)=="tcls14"), 
                 which(colnames(newdat)=="tcls251"))

sl-bergquist/SLscreeners documentation built on Dec. 2, 2019, 1:29 a.m.