tidymodels / model-implementation-principles

recommendations for creating R modeling packages
https://tidymodels.github.io/model-implementation-principles/
41 stars 4 forks source link

Don't keep estimates in multiple objects #17

Open alexpghayes opened 5 years ago

alexpghayes commented 5 years ago

See https://github.com/tidymodels/broom/issues/663 for example, or a number of the bootstrap-style things that I can't remember. All the estimates should live in a single objects, otherwise you end with an interface like

do_something_with_model(first_half_of_estimates, second_half_of_estimates, ...)

which is not intuitive and a pain. Another example of this: https://github.com/tidymodels/broom/blob/master/R/joinerml-tidiers.R#L9.

It's perhaps worth providing advice on what do when wrapping / extending existing functions / objects instead of implementing from scratch. Advice in this vein might belong more to https://github.com/alexpghayes/kaboom

alexpghayes commented 5 years ago

I'm not sure if I feel this is a bad thing anymore. Need to think more about where estimates should live and how they should be grouped.