-
Notifications
You must be signed in to change notification settings - Fork 23
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
Do not allow fitted recipes #179
Comments
Maybe if (recipes::is_trained(recipe)) {
abort("Can't add a trained recipe to a workflow.")
} I wouldn't worry too much about partially trained recipes |
Unfortunately the library(recipes)
rec <- recipe(mpg ~ cyl, mtcars)
rec_trained <- recipe(mpg ~ cyl, mtcars) %>% prep()
all(purrr::map_lgl(rec$steps, is_trained))
#> [1] TRUE
all(purrr::map_lgl(rec_trained$steps, is_trained))
#> [1] TRUE From the "tr_info" %in% names(rec)
#> [1] FALSE
"tr_info" %in% names(rec_trained)
#> [1] TRUE @EmilHvitfeldt, would you game for a PR that transitions Created on 2023-05-05 with reprex v2.0.2 |
Are you looking for library(recipes)
rec <- recipe(mpg ~ cyl, mtcars)
rec_trained <- recipe(mpg ~ cyl, mtcars) %>% prep()
fully_trained(rec)
#> [1] FALSE
fully_trained(rec_trained)
#> [1] TRUE |
Perfect, thanks so much @EmilHvitfeldt! |
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. |
Another thing that I've seen is that people prep a recipe then use
add_recipe()
. Can we error when that happens and add something to the man file foradd_recipe()
?Created on 2022-09-21 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: