broom.helpers
broom.helpers copied to clipboard
Improve output for workflows/parsnip objects estimated with tidymodels
The tidymodels objects don't have the same 'terms' information in a standard model. But I do think all this information is stored in the object. Like I mentioned before, I am no tidymodels expert, but here I some tidbits I think are helpful for tackling this issue.
- workflows/parnsip models don't use
model.frame()
andmodel.matrix()
. Rather they usemodel_frame()
andmodel_matrix()
that do not remove missing data from the return data frame/matrix. - I think there is something similar for terms?
- I think parsnip has it's own tidiers? Not sure if it's full featured with all models supported? Not sure how workflows fall into this.
- Given a workflow object, there is a function to extract the parsnip fit. There is a followup function that you can use to extract the original model fit from there.
- tidymodels creates dummy variables from categorical variables. This could pose an issue identifying the underlying variable, and subsequently adding header rows.
I am not sure what the best way to add support for these objects, but I think it'll be a combination of updates to broom.helpers and gtsummary (passing a default tidier for these model types). I think this will be helpful to add, but to be honest, I am not sure I have the time right now. So we can just keep this open until one of us can get to it?