View source: R/mod_cv_penalized.R
mod_cv_penalized | R Documentation |
Fits a GLM penalized model using k-fold cross-validation to tune the alpha and lambda hyperparameters
mod_cv_penalized( data, x_names = character(), y_name, alpha = seq(0, 1, by = 0.2), cv_strat = "min", n_folds = 10, type_measure = "mse" )
data |
A numeric dataset in matrix-convertible format |
x_names |
A character vector of explainatory variables names |
y_name |
A character naming the variable to explain |
alpha |
A numeric vector of alpha to use for the cross-validation |
cv_strat |
A character telling which alpha should be consider optimal "min": minimize the error "1se": selects less variables while allowing a greater error (min + 1se) |
n_folds |
An integer giving the number of folds tu use in k-folds cv |
type_measure |
A character naming the error metric used for the cross-validation (defaults to "mse") |
The fitted model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.