tidymodels / censored

Parsnip wrappers for survival models
https://censored.tidymodels.org/
Other
123 stars 12 forks source link

Use `summary.survfit()` for tree-based models #224

Closed hfrick closed 2 years ago

hfrick commented 2 years ago

Closes https://github.com/tidymodels/censored/issues/146

This PR is a follow-up to https://github.com/tidymodels/censored/pull/216 and #221 to now make use of those helper functions for survfit summary objects for tree-based models:

The predict functions for the tree models return a list with one survfit object per row in new_data. So the resulting list of survfit summary objects gets aggregated by a new helper combine_list_of_survfit_summary(). Then the objects are the same as we'd expect them from the PH models and the rest of the helpers is used.

I left all the previous tests on predictions of survival probability untouched to show that they still pass fine.

github-actions[bot] commented 2 years ago

This pull request 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.