Skip to content

Commit 1229ad1

Browse files
committed
put penalty column to the left
1 parent 2249cbb commit 1229ad1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: parsnip
22
Title: A Common API to Modeling and Analysis Functions
3-
Version: 1.0.3.9000
3+
Version: 1.0.3.9002
44
Authors@R: c(
55
person("Max", "Kuhn", , "max@rstudio.com", role = c("aut", "cre")),
66
person("Davis", "Vaughan", , "davis@rstudio.com", role = "aut"),

R/multinom_reg.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,13 @@ multi_predict._multnet <-
236236
names(pred) <- NULL
237237
pred <- map_dfr(pred, function(x) x)
238238
pred$penalty <- rep(penalty, each = nrow(new_data))
239+
pred <- dplyr::relocate(pred, penalty)
239240
} else {
240241
pred <-
241242
tibble(
242243
.row = rep(1:nrow(new_data), length(penalty)),
243-
.pred_class = factor(as.vector(pred), levels = object$lvl),
244-
penalty = rep(penalty, each = nrow(new_data))
244+
penalty = rep(penalty, each = nrow(new_data)),
245+
.pred_class = factor(as.vector(pred), levels = object$lvl)
245246
)
246247
}
247248

0 commit comments

Comments
 (0)