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

throw error for single eval time in brier_survival_integrated() #467

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

EmilHvitfeldt
Copy link
Member

To close #460

library(censored)
library(yardstick)

lung_surv <- lung %>% 
  dplyr::mutate(surv = Surv(time, status), .keep = "unused")

cox <- proportional_hazards() %>% 
  fit(surv ~ ., data = lung_surv)

pred <- augment(cox, lung_surv, eval_time = 10)

brier_survival_integrated(
  data = pred,
  truth = surv,
  .pred
)
#> Error in `brier_survival_integrated()`:
#> ! At least 2 evaluation time is required. Only 1 unique time was given.

@EmilHvitfeldt EmilHvitfeldt merged commit 97adb7a into main Dec 13, 2023
12 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the fix-460 branch December 13, 2023 21:52
Comment on lines +97 to +98
"At least 2 evaluation time{?s} {?is/are} required. \\
Only {num_eval_times} unique time{?s} {?was/were} given."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the pluralization is overkill here :) The requirement is always "at least 2" and {num_eval_times} is not going to be 2 or more when we trigger that error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new and improved in #470

brier_survival_integrated(data = lung_surv, truth = surv_obj, .pred)
Condition
Error in `brier_survival_integrated()`:
! At least 2 evaluation time is required. Only 1 unique time was given.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this slightly off message is what caught my eye :)

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 Dec 29, 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.

Integrated survival metrics should warn when used with a single time point in eval_time
2 participants