-
Notifications
You must be signed in to change notification settings - Fork 54
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
Apply stricter .eval_time checking for dynamic survival metrics #468
Conversation
There is no NEWS bullet since these functions are not official yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One important question about the ordering of eval_time
though, see the comments 🙌
cli::cli_abort( | ||
c( | ||
x = "Negative values of {.field .eval_time} are not allowed.", | ||
i = "The following negative values were found: {.val {offenders}}." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
R/validation.R
Outdated
any_not_in_order <- any( | ||
vapply(all_eval_times_list, function(x) is.unsorted(x), logical(1)) | ||
) | ||
if (any_not_in_order) { | ||
cli::cli_abort( | ||
c( | ||
x = "Values of {.field .eval_time} must be in increasing order." | ||
), | ||
call = call | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tune, we explicitly make use of the order of time points in eval_time
: for Bayesian optimization and the tuning functions in finetune (racing etc), we can only optimize for one time point so the functions use the first one. If you want to optimize for 10
but also want the metrics to be calculated for 5
, you would set eval_time = c(10, 5)
. Is the order a requirement from yardstick? If so, we need to decide where the re-ordering should happen. If not, we can just remove this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove the check + add tests to make sure that out of order eval_time
works in {yardstick}
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. |
to close #462
Created on 2023-12-13 with reprex v2.0.2