recipes
recipes copied to clipboard
Proposal: Unification of stored objects in recipes
I don't have a solution proposal to this one yet, so I'm just going to comment.
The trained steps have a named argument in their step to pass around the sufficient information that was trained during prep.*().
It would be nice if there was a consistently named argument in steps that were used to store this information across the steps.
step_pca() uses res, step_impute_linear() uses model.
Alternatively, we could formalize what is generally required in a step() and then anything else that is required for a particular method could go in $extras.
Like:
step <- function(class, id, ..., skip = FALSE, role = NA, trained = FALSE, extras = list()) {
check_dots_empty() # dots are used to force named args only
}
I did have a tough experience today designing a step and forgetting exactly which of these fields are required, because they aren't in the step() constructor even though they are needed.
Even better!