-
Notifications
You must be signed in to change notification settings - Fork 42
Custom recipe steps don't work when tuning is done in parallel #192
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
Comments
I have the same bug when I try tuning in parallel using a step form the |
I experienced the same issue with themis::step_smote() The same codes worked when I used themis::step_downsample() instead. I don't think I could use the !!variable method as suggested in the link, because I wanted to put a column name in step_smote(). I can post my codes if needed. Is this issue fixed and I missed out something or is this still something under development? I see the pull request that has been merged but I don't see how I can fix it (sorry I'm quite new to GitHub). |
The fix in the PR linked here was done after the latest CRAN release. Do you have the development version of the package from GitHub? You can install via: # if needed: install.packages("devtools")
devtools::install_github("tidymodels/tune") We are planning a new CRAN release for tune pretty soon, so that this fix will be available more broadly. If you are able, can you try this out and see if your problem is fixed? |
I misspoke! This is fixed in the current version of recipes: # if needed: install.packages("devtools")
devtools::install_github("tidymodels/recipes") Open a new issue if you continue to have a problem after updating! 🙌 |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
The problem
When a custom recipe step is created, it can be used in a tuning grid when the tuning grid is run sequentially, ie. control_grid(allow_par = FALSE), but not when the tuning grid is run in parallel, ie. allow_par = TRUE.
When run in parallel the following error occurs (in this case I am using the step_percentile example custom step):
Reproducible example
Below I used the example code from the recipes package for creating a custom step, and from the tune package for running a model through a tuning grid, with a few modifications that are mostly noted. You will see at the bottom of the example the "no applicable method for 'prep'" error. I should also note that I've tried adding step_percentile to a package and adding pkgs="MyPackage" to the control_grid, but this did not make a difference.
In a second version version of the code, which I've placed underneath, I've modified it to run sequentially and it runs correctly without any issues.
You can skip to the last 20 lines of the example to see the actual relevant code. Above that is just the definition of the custom step.
Failing Parallel Version
Created on 2020-04-03 by the reprex package (v0.3.0)
Session info
Working Sequential Version
Created on 2020-04-03 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: