-
Notifications
You must be signed in to change notification settings - Fork 1
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
Workshop test on Graf weight time #98
Conversation
surv_obj <- survival::Surv(time = c(10, 12), event = c(0, 1)) | ||
expect_equal( | ||
parsnip:::graf_weight_time_vec(surv_obj, eval_time = NULL), | ||
logical(0) |
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.
Just to confirm: this is the result we want to see for eval_time = NULL
? Also noting that, unlike the case for eval_time = NA
, this does not return anything of the same length as the Surv object.
eval_11[!na_11], | ||
seq(2, 10, by = 2) | ||
parsnip:::graf_weight_time_vec(surv_obj, eval_time = NA), | ||
c(NA, NA) |
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.
I think this makes sense as a return value for eval_time = NA
but as for the NULL case, just wanted you to confirm here
expect_equal( | ||
parsnip:::graf_weight_time_vec(observed_time_gt_eval_time, eval_time = eval_time_10), | ||
rep(eval_time_10, 2) | ||
) |
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.
Noting here that the modification to avoid data leakage (subtracting eps
) is flying under the radar of expect_equal()
. Same for Category 1.
Conflicts: tests/testthat/_snaps/parsnip-survival-censoring-weights.md
This PR workshops the test on
parsnip:::graf_weight_time_vec()
. The differences are probably easier to read commit-by-commit rather than aggregated.