Description Usage Arguments Details Value Examples
lasso implements standard LASSO regression and classification.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
train_df |
An input dataframe with |
formula |
A formula for the regression specification. |
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. 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. |
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 lasso function implements LASSO regression, as found in the gamlr package, for variable selection and prediction. 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 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.