tidymodels / censored

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

fix pred survival for single obs #256

Closed hfrick closed 1 year ago

hfrick commented 1 year ago

closes #255

library(censored)
#> Loading required package: parsnip
#> Loading required package: survival

decision_tree(engine = "rpart") %>%
  set_mode("censored regression") %>%
  fit(Surv(time, status) ~ ., data = lung) %>%
  predict(lung[2,], type = "survival", eval_time = c(100, 200))
#> # A tibble: 1 × 1
#>                .pred
#>   <list<tibble[,2]>>
#> 1            [2 × 2]

Created on 2023-04-11 with reprex v2.0.2

github-actions[bot] commented 1 year 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.