Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Add option to control_* functions to do a test run on only one resample to check for warnings/errors #872

Open
joranE opened this issue Mar 16, 2024 · 4 comments
Labels
feature a feature request or enhancement

Comments

@joranE
Copy link

joranE commented Mar 16, 2024

Feature

In situations when I'm exploring multiple preprocessors & models it can be really frustrating to run code such as:

results <- 
  # set of workflows with possibly multiple preprocessors & models
  wfl_set |> 
  workflow_map(
    resamples = cv_folds, 
    fn = "tune_grid", 
    metrics = metric_set(roc_auc, accuracy, precision)  
)

...and have it chug through 90% of the combinations & folds only to hit some combination late in the run where all models fail because I've made a mistake in my recipe or engine definitions.

Obviously, it's possible to test each recipe & model spec individually before tossing them all at the parameter tuning, but that can involve quite a bit more work & code that you ultimately end up writing more or less only for the purpose of verifying that everything merely runs without errors (or warnings).

I feel like it might be a significant time saver if there were an option in functions like control_grid, eg control_grid(preliminary = TRUE) that ran each workflow on only a single resample and a single parameter combination merely for the purposes of validating that the preprocessor & models run without error.

I realize that this won't catch 100% of potential errors due to weird variations in either the cv folds or the parameter combinations, but I feel like it has the potential to significantly speed up the loop of writing code, running, finding problems and fixing them.

@simonpcouch
Copy link
Contributor

Ah, interesting. Related to #722.

I do feel like a control argument in each control_*() function is more appealing to me as an interface than a separate pilot_*() function for each tuning function. Less clutter in the namespace and less code redundancy.

@joranE
Copy link
Author

joranE commented Mar 18, 2024

Oh, weird, that related issue was apparently prompted by a mastodon post by me? This is an odd variation on searching for how to do something and landing on my own SO answer.

@EmilHvitfeldt
Copy link
Member

I agree @simonpcouch! This feels ergonomically very similar to turning on and off verbose

@simonpcouch
Copy link
Contributor

This blog post makes some points that might support adding this feature: https://www.mm218.dev/posts/2024-07-19-tidymodels/

@EmilHvitfeldt EmilHvitfeldt added the feature a feature request or enhancement label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants