-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
featurea feature request or enhancementa feature request or enhancement
Description
If a tailor object has not tuning parameters or estimation, we should have an API that let's us just push predictions through.
fit.action_tailor() is where the columns names. are set. However, we can update the tailor objects with that information from the workflow.
For example:
get_output_columns <- function(x, syms = FALSE) {
mod_res <- extract_fit_parsnip(x)
mod_mode <- mod_res %>% purrr::pluck("spec") %>% purrr::pluck("mode")
if (mod_mode == "regression") {
res <- list(estimate = ".pred", probabilities = character(0))
} else if (mod_mode == "classification") {
res <-
list(
estimate = ".pred_class",
probabilities = paste0(".pred_", mod_res$lvl)
)
} else {
cli::cli_abort("Unsupported model mode: {mod_mode}")
}
res <- c(list(outcome = outcome_names(x)), res)
if (syms) {
res <- purrr::map(res, rlang::syms)
}
res
}could be used to populate the columns.
The reason for this is that the tune package will have to step through an unneeded loop and have a loft of redundant computations.
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement