We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 44730af + 539e8aa commit 5dd6fecCopy full SHA for 5dd6fec
R/predict.R
@@ -239,6 +239,15 @@ prepare_data <- function(object, new_data) {
239
new_data <- convert_form_to_xy_new(object$preproc, new_data)$x
240
}
241
242
+
243
+ remove_intercept <-
244
+ get_encoding(class(object$spec)[1]) %>%
245
+ dplyr::filter(mode == object$spec$mode, engine == object$spec$engine) %>%
246
+ dplyr::pull(remove_intercept)
247
+ if (remove_intercept) {
248
+ new_data <- new_data[, colnames(new_data) != "(Intercept)", drop = FALSE]
249
+ }
250
251
switch(
252
fit_interface,
253
none = new_data,
0 commit comments