-
Notifications
You must be signed in to change notification settings - Fork 42
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
int_pctl()
should pick the _first_ eval time if eval_time = NULL
#809
Comments
I think that we should make the default (i.e. For the I think the use case is different for library(tidymodels)
library(censored)
#> Loading required package: survival
library(doMC)
#> Loading required package: foreach
#>
#> Attaching package: 'foreach'
#> The following objects are masked from 'package:purrr':
#>
#> accumulate, when
#> Loading required package: iterators
#> Loading required package: parallel tidymodels_prefer()
theme_set(theme_bw())
options(pillar.advice = FALSE, pillar.min_title_chars = Inf)
registerDoMC(cores = parallel::detectCores()) set.seed(1)
sim_dat <- prodlim::SimSurv(500) %>%
mutate(event_time = Surv(time, event)) %>%
select(event_time, X1, X2)
set.seed(2)
split <- initial_split(sim_dat)
sim_tr <- training(split)
sim_te <- testing(split)
sim_rs <- vfold_cv(sim_tr)
time_points <- 1:20
mod_spec <-
bag_tree() %>%
set_mode("censored regression")
rsctrl <- control_resamples(save_pred = TRUE)
mix_mtrc <- metric_set(brier_survival)
set.seed(2193)
rs__res <-
mod_spec %>%
fit_resamples(
event_time ~ X1 + X2,
resamples = sim_rs,
metrics = mix_mtrc,
eval_time = time_points,
control = rsctrl
)
set.seed(1)
int_pctl(rs__res, times = 2000, eval_time = time_points) %>%
ggplot(aes(.eval_time)) +
geom_line(aes(y = .estimate)) +
geom_ribbon(aes(ymin = .lower, ymax = .upper), alpha = 1 / 10) +
labs(x = "Time", y = "Brier Score") If they don't want them all, they could opt-in to excluding time points. I think that multiple metrics is a good analogy; if they specify all of our event time metrics, they probably want intervals for all of them. |
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. |
Part of #766
int_pctl()
should pick the first eval time stored in the object ifeval_time = NULL
is provided by the user.Plus, choosing an eval time in this case is currently broken. AKA we need some tests for this in extratests, now filed as tidymodels/extratests#163.
Created on 2024-01-16 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: