glmnet_sampler | R Documentation |
This assumes a continuous response, so that the out-of-sample MSE can be used to estimate the outcome variability sigma.
glmnet_sampler(fits, newdata = NULL, indices = NULL, lambda_ix = 1, ...)
fits |
The fitted 'glmnet' package model model from which to draw samples. |
newdata |
A data.frame containing new inputs from which to sample responses. If NULL, defaults to the data used to estimate fit. |
indices |
The coordinates of the response from which to draw samples. |
lambda_ix |
A regularization strength parameter used to maintain consistency with estimation. Not used during sampling. |
... |
Additional parameters to pass to predict.glmnet |
y_star A data.frame of samples y associated with the new inputs.
m <- glmnet_model()
fit <- estimator(m)(mpg ~ hp + wt, data = mtcars)
glmnet_sampler(fit, mtcars)
plm <- parallelize(glmnetUtils::glmnet)
fit <- plm(mpg + disp ~ hp + wt, data = mtcars)
glmnet_sampler(fit, mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.