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

int_pctl.tune_results() errors with survival model #813

Closed
hfrick opened this issue Jan 16, 2024 · 2 comments
Closed

int_pctl.tune_results() errors with survival model #813

hfrick opened this issue Jan 16, 2024 · 2 comments

Comments

@hfrick
Copy link
Member

hfrick commented Jan 16, 2024

Similar to #812 but with a survival model and a different error

library(tidymodels)
library(censored)
#> Loading required package: survival

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

# non-dynamic metric
set.seed(2193)
tune_res <-
  proportional_hazards(penalty = tune(), engine = "glmnet") %>%
  tune_grid(
    surv ~ .,
    resamples = vfold_cv(lung_surv, 2),
    grid = 2,
    control = control_grid(save_pred = TRUE),
    metrics = metric_set(concordance_survival, brier_survival_integrated),
    eval_time = c(10, 20)
  )
foo <- int_pctl(tune_res, times = 2, metrics = "concordance_survival")
#> Error in `purrr::map2()`:
#> ℹ In index: 1.
#> Caused by error in `dplyr::rename()`:
#> ! Can't rename columns that don't exist.
#> ✖ Column `term` doesn't exist.

foo <- int_pctl(tune_res, times = 2, metrics = "brier_survival_integrated")
#> Error in `purrr::map2()`:
#> ℹ In index: 1.
#> Caused by error in `dplyr::rename()`:
#> ! Can't rename columns that don't exist.
#> ✖ Column `term` doesn't exist.

Created on 2024-01-16 with reprex v2.0.2

topepo added a commit that referenced this issue Jan 19, 2024
* verify that the 'metrics' argument is a metric set for #813 and #812

* Update R/int_pctl.R

Co-authored-by: Hannah Frick <[email protected]>

* update snapshot

---------

Co-authored-by: Hannah Frick <[email protected]>
@topepo
Copy link
Member

topepo commented Jan 25, 2024

Closed by #818 and tidymodels/extratests#180

@topepo topepo closed this as completed Jan 25, 2024
Copy link

github-actions bot commented Feb 9, 2024

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.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants