Proposed modifications to the internals of tune:::check_grid
.
tune_tbl <- tune_args(workflow)
tune_params <- tune_tbl$id
if (nrow(pset) == 0L) {
msg <- c("!" = "No tuning parameters have been detected; performance will be
evaluated using the resamples with no tuning.")
if (isTRUE(nrow(tune_tbl) > 0)) {
from_model <- all(tune_tbl$source == "model_spec")
engine <- extract_spec_parsnip(workflow)$engine
engine_snippet <- paste0(' with the specified engine "', engine, '"')
msg <-
c(msg,
i = "{cli::qty(tune_params)}The parameter{?s} {.var {tune_params}} {?was/were}
marked with `tune()`, though {?is/are} not supported for
tuning{if (from_model) engine_snippet}.")
} else {
msg <- c(msg, "i" = "Did you want to `tune()` parameters?")
}
cli::cli_warn(msg)