Skip to content

Commit

Permalink
switch out deprecated extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Jul 22, 2021
1 parent 1259c51 commit c8ba315
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/add_candidates.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ add_candidates.default <- function(data_stack, candidates, name, ...) {
.set_mode_ <- function(stack, candidates, name) {
wf_spec <-
attr(candidates, "workflow") %>%
workflows::pull_workflow_spec()
workflows::extract_spec_parsnip()

new_mode <- wf_spec$mode
old_mode <- attr(stack, "mode")
Expand Down Expand Up @@ -363,7 +363,7 @@ update_stack_data <- function(stack, new_data) {
stack_workflow <- function(x) {
res <-
workflows::workflow() %>%
workflows::add_model(workflows::pull_workflow_spec(x))
workflows::add_model(workflows::extract_spec_parsnip(x))

pre <- workflows::pull_workflow_preprocessor(x)

Expand Down
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ top_coefs <- function(x, penalty = x$penalty$penalty, n = 10) {
sub_models <-
purrr::map_dfr(x$cols_map, ~ tibble::tibble(terms = .x), .id = "model_name")
model_types <-
purrr::map(x$model_defs, workflows::pull_workflow_spec) %>%
purrr::map(x$model_defs, workflows::extract_spec_parsnip) %>%
purrr::map_dfr(~ tibble::tibble(model_type = class(.x)[1]), .id = "model_name")
res <-
dplyr::left_join(betas, sub_models, by = "terms") %>%
Expand Down

0 comments on commit c8ba315

Please sign in to comment.