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.
1 parent bb5e98e commit 57d3ca5Copy full SHA for 57d3ca5
R/predict.R
@@ -244,7 +244,7 @@ prepare_data <- function(object, new_data) {
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) {
+ if (remove_intercept & any(grepl("Intercept", names(new_data)))) {
248
new_data <- new_data %>% dplyr::select(-dplyr::one_of("(Intercept)"))
249
}
250
0 commit comments