Skip to content
🤠 📿 The Highly Adaptive Lasso
R C++ Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data
docs
inst
man
sandbox
src
tests update Coxnet test + restyle Nov 29, 2019
vignettes
.Rbuildignore
.gitignore
.travis.yml
CONTRIBUTING.md
DESCRIPTION
LICENSE
Makefile
NAMESPACE
NEWS.md
README.Rmd
README.md
_pkgdown.yml
appveyor.yml
codecov.yml
cran-comments.md
hal9001.Rproj

README.md

R/hal9001

Travis-CI Build Status AppVeyor Build Status Coverage Status CRAN CRAN downloads Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: GPL v3 DOI

The Scalable Highly Adaptive Lasso

Authors: Jeremy Coyle, Nima Hejazi, and Mark van der Laan


What’s hal9001?

hal9001 is an R package providing an implementation of the scalable highly adaptive lasso (HAL), a nonparametric regression estimator that applies L1-regularized regression (i.e., the lasso) to a design matrix composed of indicator functions corresponding to a set of covariates and interactions thereof. Recent theoretical results show that HAL is endowed with several important optimality properties, making it well-suited for the estimation of highly complex functional forms while attaining fast convergence rates ((n^(1/4)) and better) when used in the estimation of nuisance functions. HAL has been quite successfully used in the construction of estimators at the intersection of semiparametric theory and nonparametric causal inference (e.g., the construction of efficient one-step or targeted minimum loss estimators).

For detailed discussions of the highly adaptive lasso estimator, consider consulting Benkeser and van der Laan (2016), van der Laan (2017a), and van der Laan (2017b), among other recent works.


Installation

To contribute, install the development version of hal9001 from GitHub via remotes:

remotes::install_github("tlverse/hal9001", build_vignettes = FALSE)

Issues

If you encounter any bugs or have any specific feature requests, please file an issue.


Example

This minimal example shows how to use hal9001 to obtain predictions based on the Highly Adaptive Lasso. For details on the properties of the estimator, the interested reader is referred to Benkeser and van der Laan (2016) and van der Laan (2017a).

# load the hal9001 package
library(hal9001)
#> Loading required package: Rcpp
#> hal9001 v0.2.5: The Scalable Highly Adaptive Lasso

# simulate data
set.seed(385971)
n <- 100
p <- 3
x <- xmat <- matrix(rnorm(n * p), n, p)
y <- x[, 1] * sin(x[, 2]) + rnorm(n, mean = 0, sd = 0.2)

# fit the HAL regression
hal_fit <- fit_hal(X = x, Y = y)
#> [1] "I'm sorry, Dave. I'm afraid I can't do that."
hal_fit$times
#>                   user.self sys.self elapsed user.child sys.child
#> enumerate_basis       0.002    0.000   0.002          0         0
#> design_matrix         0.001    0.000   0.001          0         0
#> remove_duplicates     0.006    0.000   0.006          0         0
#> reduce_basis          0.000    0.000   0.000          0         0
#> lasso                 0.314    0.008   0.322          0         0
#> total                 0.323    0.008   0.331          0         0

# training sample prediction
preds <- predict(hal_fit, new_data = x)
mean(hal_mse <- (preds - y)^2)
#> [1] 0.006991539

Contributions

Contributions are very welcome. Interested contributors should consult our contribution guidelines prior to submitting a pull request.


Citation

After using the hal9001 R package, please cite the following:

    @manual{coyle2019hal9001,
      author = {Coyle, Jeremy R and Hejazi, Nima S and {van der Laan}, Mark
        J},
      title = {{hal9001}: The scalable highly adaptive lasso},
      year  = {2019},
      howpublished = {\url{https://github.com/tlverse/hal9001}},
      note = {{R} package version 0.2.5},
      url = {https://doi.org/10.5281/zenodo.3558314},
      doi = {10.5281/zenodo.3558314}
    }

License

© 2017-2019 Jeremy R. Coyle & Nima S. Hejazi

The contents of this repository are distributed under the GPL-3 license. See file LICENSE for details.


References

Benkeser, David, and Mark J van der Laan. 2016. “The Highly Adaptive Lasso Estimator.” In 2016 IEEE International Conference on Data Science and Advanced Analytics (DSAA). IEEE. https://doi.org/10.1109/dsaa.2016.93.

van der Laan, Mark J. 2017a. “A Generally Efficient Targeted Minimum Loss Based Estimator Based on the Highly Adaptive Lasso.” The International Journal of Biostatistics. De Gruyter. https://doi.org/10.1515/ijb-2015-0097.

———. 2017b. “Finite Sample Inference for Targeted Learning.” ArXiv E-Prints.

You can’t perform that action at this time.