Open EmilHvitfeldt opened 3 years ago
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!
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()
usesres
,step_impute_linear()
usesmodel
.