tidymodels / censored

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

Prediction of survival prob for single obs with `decision_tree(engine = "rpart")` #255

Closed hfrick closed 1 year ago

hfrick commented 1 year ago
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))
#> Warning in seq_len(nrow(x)): first element used of 'length.out' argument
#> Error in seq_len(nrow(x)): argument must be coercible to non-negative integer

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

github-actions[bot] commented 1 year ago

This issue 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.