Skip to content

Commit 4f04f77

Browse files
committed
Use linear_reg translate for multinom_reg for now
1 parent 40101e0 commit 4f04f77

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

R/multinom_reg.R

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,29 +96,7 @@ print.multinom_reg <- function(x, ...) {
9696
}
9797

9898
#' @export
99-
translate.multinom_reg <- function(x, engine = x$engine, ...) {
100-
x <- translate.default(x, engine, ...)
101-
102-
if (engine == "glmnet") {
103-
check_glmnet_penalty(x)
104-
if (any(names(x$eng_args) == "path_values")) {
105-
# Since we decouple the parsnip `penalty` argument from being the same
106-
# as the glmnet `lambda` value, `path_values` allows users to set the
107-
# path differently from the default that glmnet uses. See
108-
# https://github.com/tidymodels/parsnip/issues/431
109-
x$method$fit$args$lambda <- x$eng_args$path_values
110-
x$eng_args$path_values <- NULL
111-
x$method$fit$args$path_values <- NULL
112-
} else {
113-
# See discussion in https://github.com/tidymodels/parsnip/issues/195
114-
x$method$fit$args$lambda <- NULL
115-
}
116-
# Since the `fit` information is gone for the penalty, we need to have an
117-
# evaluated value for the parameter.
118-
x$args$penalty <- rlang::eval_tidy(x$args$penalty)
119-
}
120-
x
121-
}
99+
translate.multinom_reg <- translate.linear_reg
122100

123101
# ------------------------------------------------------------------------------
124102

0 commit comments

Comments
 (0)