Skip to content

Commit

Permalink
address slowdown in fit_xy() (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Feb 27, 2024
1 parent 5491946 commit 60f97cd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/fit_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,14 @@ xy_form <- function(object, env, control, ...) {

check_outcome(env$y, object)

encoding_info <-
get_encoding(class(object)[1]) %>%
dplyr::filter(mode == object$mode, engine == object$engine)
encoding_info <- get_encoding(class(object)[1])
encoding_info <-
vctrs::vec_slice(
encoding_info,
encoding_info$mode == object$mode & encoding_info$engine == object$engine
)

remove_intercept <- encoding_info %>% dplyr::pull(remove_intercept)
remove_intercept <- encoding_info$remove_intercept

data_obj <-
.convert_xy_to_form_fit(
Expand Down

0 comments on commit 60f97cd

Please sign in to comment.