Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up predictions of survival probabilities for proportional hazards models? #47

Closed
hfrick opened this issue Apr 22, 2021 · 2 comments · Fixed by #59
Closed

Speed up predictions of survival probabilities for proportional hazards models? #47

hfrick opened this issue Apr 22, 2021 · 2 comments · Fixed by #59

Comments

@hfrick
Copy link
Member

hfrick commented Apr 22, 2021

this applies to the survival and glmnet engines

@EmilHvitfeldt
Copy link
Member

EmilHvitfeldt commented Apr 28, 2021

It appears that at least some of the slowness comes from interpolate_km_values, but it seems to come mostly from error handling

reprex

set.seed(1234)
.times <- c(100, 200)
x <- tibble::tibble(
  .time = cumsum(sample(1:6, 100, TRUE)),
  .pred_survival = c(1, sort(runif(99), TRUE)),
  .pred_survival_lower = NA,
  .pred_survival_upper = NA,
  .pred_hazard_cumulative = cumsum(runif(100))
)

for (i in 1:1000)
  censored:::interpolate_km_values(x, .times)

Screen Shot 2021-04-27 at 8 02 36 PM

Screen Shot 2021-04-27 at 8 02 50 PM

@github-actions
Copy link

github-actions bot commented Nov 5, 2021

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.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2021
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 a pull request may close this issue.

2 participants