hal: hal

Description Usage Arguments

Description

The highly adaptive lasso fitting function. This function takes a matrix of predictor values (which can be binary or continuous) and converts it into a set of indicator basis functions that perfectly fit the data. The function then uses cross-validated lasso (via the glmnet package) to select basis functions. The resulting fit is called the highly adaptive lasso. The process of creating the indicator basis functions can be extremely time and memory intensive as it involves creating n(2^d - 1) basis functions, where n is the number of observations and d the number of covariates. The function also must subsequently search over basis functions for those that are duplicated and store the results. Future implementations will attempt to streamline this process to the largest extent possible; however, for the time being implementing with values of n and d such that n(2^d - 1) > 1e7 is not recommended.

Usage

1
2
3
hal(Y, X, newX = NULL, verbose = FALSE, obsWeights = rep(1, length(Y)),
  nfolds = ifelse(length(Y) <= 100, 20, 10), nlambda = 100, useMin = TRUE,
  debug = TRUE, parallel = FALSE, ...)

Arguments

Y

A numeric of outcomes

X

A data.frame of predictors

newX

Optional data.frame on which to return predicted values

verbose

A boolean indicating whether to print output on functions progress

obsWeights

Optional vector of observation weights to be passed to cv.glmnet

nfolds

Number of CV folds passed to cv.glmnet

nlambda

Number of lambda values to search across in cv.glmnet

useMin

Option passed to cv.glmnet, use minimum risk lambda or 1se lambda (more penalization)

debug

For benchmarking. Setting to TRUE will run garbage collection to improve the accuracy of memory monitoring

parallel

A boolean indicating whether to use a parallel backend, if possible

...

Not currently used


benkeser/halplus documentation built on May 12, 2019, noon