Skip to content

Commit c98a441

Browse files
committed
Reorder new_data columns for glmnet
1 parent a272a2c commit c98a441

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/linear_reg_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ set_pred(
168168
args =
169169
list(
170170
object = expr(object$fit),
171-
newx = expr(as.matrix(new_data)),
171+
newx = quote(as.matrix(new_data[, rownames(object$fit$beta)])),
172172
type = "response",
173173
s = expr(object$spec$args$penalty)
174174
)

R/logistic_reg_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ set_pred(
187187
args =
188188
list(
189189
object = quote(object$fit),
190-
newx = quote(as.matrix(new_data)),
190+
newx = quote(as.matrix(new_data[, rownames(object$fit$beta)])),
191191
type = "response",
192192
s = quote(object$spec$args$penalty)
193193
)

0 commit comments

Comments
 (0)