Description Usage Arguments Details Value Examples
bolasso
implements Bootstrapped LASSO regression and classification.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
train_df |
An input dataframe with |
nboot |
A numeric value specifying the number of bootstrap replicates. |
formula |
A formula for the covariates. |
family |
A string that specifies either 'gaussian' or 'binomial'. |
test_df |
A dataframe containing the same columns as |
predict_df |
A dataframe matching |
free_vars |
A string or character vector specifying which covariate(s) to never penalize. This argument is optional. |
nfold |
The number of cross-validation folds. Only specify if cross-validation is desired. This argument is optional. |
lambda |
A string specifying which lambda to use for prediction when utilizing cross-validation. Typically either "min" or "1se". Default value is "min". |
sparsity_threshold |
A numeric value in [0, 1]. Any variable with a percentage of sparsity greater than this value will be dropped. This argument is optional. |
selection_threshold |
A numeric value in [0, 1]. Variables must be selected in at least this percentage of bootstrap replicates. Default value is 0.9. |
verbose |
Logical indicating whether to return progress statements.
Default is |
... |
Generic argument to which you can pass any other valid gamlr
argument, such as |
The bolasso function bootstraps LASSO regression, as found in the gamlr package, across n bootstrap partitions. This achieves more robust variable selection than standard LASSO and improves predictive accuracy. It handles standard OLS regression and binomial logistic regression.
A list containing the LASSO model
, predicted_values
,
residuals
, and selected variables
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
idx <- train_test_validate(iris$Sepal.Length, train.p = .6, test.p = .2)
initialize_parallel()
bolasso_model <- bolasso(train_df = iris[idx$train, ],
nboot =100,
formula = Sepal.Length ~ .,
family = "gaussian",
test_df = iris[idx$test, ],
predict_df = iris[idx$validate, ],
nfold = 5,
verbose = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.