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

Workshop test on Graf weight time #98

Merged
merged 8 commits into from
Jan 4, 2024
Merged

Workshop test on Graf weight time #98

merged 8 commits into from
Jan 4, 2024

Conversation

hfrick
Copy link
Member

@hfrick hfrick commented May 17, 2023

This PR workshops the test on parsnip:::graf_weight_time_vec(). The differences are probably easier to read commit-by-commit rather than aggregated.

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)
Copy link
Member Author

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)
Copy link
Member Author

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

Comment on lines +22 to +25
expect_equal(
parsnip:::graf_weight_time_vec(observed_time_gt_eval_time, eval_time = eval_time_10),
rep(eval_time_10, 2)
)
Copy link
Member Author

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.

tests/testthat/test-parsnip-survival-censoring-weights.R Outdated Show resolved Hide resolved
@hfrick hfrick merged commit c70f7da into main Jan 4, 2024
5 checks passed
@hfrick hfrick deleted the workshop-weight-time branch January 4, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant