Skip to content

Commit 143fd7d

Browse files
authored
restore tidy.glmnet(penalty) default (#1192)
1 parent f2df9f7 commit 143fd7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/tidy_glmnet.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ get_glmn_coefs <- function(x, penalty = 0.01) {
5858
tidy_glmnet <- function(x, penalty = NULL, ..., call = caller_env()) {
5959
check_installs(x$spec)
6060
load_libs(x$spec, quiet = TRUE, attach = TRUE)
61+
if (is.null(penalty)) {
62+
penalty <- x$spec$args$penalty
63+
}
6164
check_number_decimal(penalty, min = 0, max = 1, allow_null = TRUE, call = call)
6265
get_glmn_coefs(x$fit, penalty = penalty)
6366
}

0 commit comments

Comments
 (0)