diff --git a/R/tidy_glmnet.R b/R/tidy_glmnet.R index 55dd8e232..c9ae65c4c 100644 --- a/R/tidy_glmnet.R +++ b/R/tidy_glmnet.R @@ -58,6 +58,9 @@ get_glmn_coefs <- function(x, penalty = 0.01) { tidy_glmnet <- function(x, penalty = NULL, ..., call = caller_env()) { check_installs(x$spec) load_libs(x$spec, quiet = TRUE, attach = TRUE) + if (is.null(penalty)) { + penalty <- x$spec$args$penalty + } check_number_decimal(penalty, min = 0, max = 1, allow_null = TRUE, call = call) get_glmn_coefs(x$fit, penalty = penalty) }