Re-using the location here means that we get the same message twice:
- once for (potentially) fitting the postprocessor, and
- once for applying the postprocessor to the model predictions
If it's not getting too noisy, we should disambiguate those two messages. Alternatively, we should send that message about postprocessing only once.
|
location <- glue::glue( |
|
"preprocessor {iter_pre}/{num_iterations_pre}, model {iter_model}/{num_iterations_model}, postprocessing {iter_pred}/{num_iterations_pred}" |
|
) |
|
current_wflow <- .catch_and_log( |
|
finalize_fit_post( |
|
wflow_with_fitted_pre_and_model, |
|
data_calibration = tailor_train_data, |
|
grid = current_sched_post |
|
), |
|
control = static$control, |
|
split_labels = split_labs, |
|
location = location, |
|
notes = notes |
|
) |
|
if (is_failure(current_wflow)) { |
|
next |
|
} |
|
|
|
# to predict, use the post-processor directly rather than the |
|
# workflow so that we don't have to generate the model predictions |
|
# a second time |
|
post_fit <- extract_postprocessor(current_wflow, estimated = TRUE) |
|
post_pred <- .catch_and_log( |
|
predict(post_fit, current_pred), |
|
control = static$control, |
|
split_labels = split_labs, |
|
location = location, |
|
notes = notes |
|
) |
Re-using the
locationhere means that we get the same message twice:If it's not getting too noisy, we should disambiguate those two messages. Alternatively, we should send that message about postprocessing only once.
tune/R/loop_over_all_stages.R
Lines 243 to 271 in 6677c46