Closed hfrick closed 9 months ago
So I don't think this is a survival issue. While that being said, I think we could spin this into some other issues that would be worth working on as the error messages are not great
I think the issue is happening because of precision in degree
. A degree
value of 5.86595467322692
doesn't exists.
collect_predictions(sr_tune_res)$degree |> unique()
#> [1] 5.045940 6.856286 9.842989 1.587631 4.243622 8.608154 5.873989
If you pick a valid combination then things work
grid_settings <-
tibble::tribble(
~dist, ~degree, ~.config,
"loglogistic", 5.86595467322692, "Iter1"
)
collect_predictions(sr_tune_res) %>%
inner_join(grid_settings)
#> Joining with `by = join_by(degree, dist, .config)`
#> # A tibble: 0 × 9
#> # ℹ 9 variables: id <chr>, .pred <list>, .row <int>, degree <dbl>, dist <chr>,
#> # .pred_time <dbl>, event_time <Surv>, .config <chr>, .iter <int>
grid_settings <- collect_predictions(sr_tune_res) %>%
select(dist, degree, .config) %>%
slice(1)
grid_settings
#> # A tibble: 1 × 3
#> dist degree .config
#> <chr> <dbl> <chr>
#> 1 loglogistic 5.05 Preprocessor1_Model1
collect_predictions(sr_tune_res) %>%
inner_join(grid_settings)
#> Joining with `by = join_by(degree, dist, .config)`
#> # A tibble: 289 × 9
#> id .pred .row degree dist .pred_time event_time .config .iter
#> <chr> <list> <int> <dbl> <chr> <dbl> <Surv> <chr> <int>
#> 1 Bootstrap1 <tibble> 2 5.05 loglogi… 96.4 96+ Prepro… 0
#> 2 Bootstrap1 <tibble> 3 5.05 loglogi… 62.7 62+ Prepro… 0
#> 3 Bootstrap1 <tibble> 8 5.05 loglogi… 118. 117+ Prepro… 0
#> 4 Bootstrap1 <tibble> 14 5.05 loglogi… 293. 196+ Prepro… 0
#> 5 Bootstrap1 <tibble> 15 5.05 loglogi… 39.2 39+ Prepro… 0
#> 6 Bootstrap1 <tibble> 17 5.05 loglogi… 72.8 72+ Prepro… 0
#> 7 Bootstrap1 <tibble> 19 5.05 loglogi… 97.4 97+ Prepro… 0
#> 8 Bootstrap1 <tibble> 21 5.05 loglogi… 49.6 49+ Prepro… 0
#> 9 Bootstrap1 <tibble> 29 5.05 loglogi… 91.3 91+ Prepro… 0
#> 10 Bootstrap1 <tibble> 34 5.05 loglogi… 41.5 41+ Prepro… 0
#> # ℹ 279 more rows
result of augment()
augment(sr_tune_res, parameters = grid_settings)
#> Warning: The original data had 400 rows but there were 232 hold-out
#> predictions.
#> # A tibble: 400 × 5
#> event_time account_length voice_mail_plan .pred .pred_time
#> <Surv> <int> <fct> <list> <dbl>
#> 1 149+ 149 yes <NULL> NA
#> 2 96+ 96 no <tibble [3 × 3]> 96.4
#> 3 62+ 62 no <tibble [3 × 3]> 62.7
#> 4 58+ 58 yes <NULL> NA
#> 5 62+ 62 no <NULL> NA
#> 6 114+ 114 yes <NULL> NA
#> 7 72 72 yes <tibble [3 × 3]> 74.1
#> 8 117+ 117 yes <tibble [3 × 3]> 118.
#> 9 96+ 96 yes <tibble [3 × 3]> 97.8
#> 10 62 62 no <tibble [3 × 3]> 63.2
#> # ℹ 390 more rows
Great sleuthing! I agree that this could be handled better and have opened that other issue: #765
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.
Reprex taken from https://github.com/tidymodels/tune/pull/703, potentially to be made more minimal
Created on 2023-11-14 with reprex v2.0.2