@@ -200,6 +200,7 @@ multi_predict._multnet <-
200200 penalty <- eval_tidy(penalty )
201201
202202 dots <- list (... )
203+
203204 if (is.null(penalty )) {
204205 # See discussion in https://github.com/tidymodels/parsnip/issues/195
205206 if (! is.null(object $ spec $ args $ penalty )) {
@@ -208,7 +209,6 @@ multi_predict._multnet <-
208209 penalty <- object $ fit $ lambda
209210 }
210211 }
211- dots $ s <- penalty
212212
213213 if (is.null(type ))
214214 type <- " class"
@@ -221,7 +221,8 @@ multi_predict._multnet <-
221221 dots $ type <- type
222222
223223 object $ spec <- eval_args(object $ spec )
224- pred <- predict.model_fit(object , new_data = new_data , type = " raw" , opts = dots )
224+ pred <- predict._multnet(object , new_data = new_data , type = " raw" ,
225+ opts = dots , penalty = penalty , multi = TRUE )
225226
226227 format_probs <- function (x ) {
227228 x <- as_tibble(x )
@@ -269,5 +270,6 @@ predict_classprob._multnet <- function(object, new_data, ...) {
269270# ' @export
270271predict_raw._multnet <- function (object , new_data , opts = list (), ... ) {
271272 object $ spec <- eval_args(object $ spec )
273+ opts $ s <- object $ spec $ args $ penalty
272274 predict_raw.model_fit(object , new_data = new_data , opts = opts , ... )
273275}
0 commit comments