Skip to content

fix pred survival for single obs#256

Merged
hfrick merged 2 commits intomainfrom
decision_tree-rpart-single-obs
Apr 11, 2023
Merged

fix pred survival for single obs#256
hfrick merged 2 commits intomainfrom
decision_tree-rpart-single-obs

Conversation

@hfrick
Copy link
Member

@hfrick hfrick commented Apr 11, 2023

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

@hfrick hfrick merged commit b107590 into main Apr 11, 2023
@hfrick hfrick deleted the decision_tree-rpart-single-obs branch April 11, 2023 16:32
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant