Open jemus42 opened 10 months ago
I think this is caused by the following rule:
since the marginal prediction (or linear predictor as is usually called) can sometimes be large enough that the exponentiation can cause the Inf
s, eg:
so a simple solution would be to return the marginal prediction itself (linear predictor)
The Cox objective might benefit from the same kind of regularization as the AFT objective, as described in Section 2.3 of https://arxiv.org/pdf/2006.04920.pdf
It also might be reasonable to clip the marginal prediction to a certain value.
In some (seemingly rare) cases, survival predictions end up being
Inf
, causing issues in downstream implementations e.g. in mlr-org/mlr3proba.Apologies for the somewhat contrived reprex using a non-CRAN package just to load a dataset and everything, but I had a hard time tracking down this issue and reproduce it somewhat concisely. It only occured with specific resampling folds and hyperparameter configs, but at least it is reliably reproducible.
Created on 2024-01-10 with reprex v2.0.2
Session info
``` r sessionInfo() #> R version 4.3.2 (2023-10-31) #> Platform: aarch64-apple-darwin20 (64-bit) #> Running under: macOS Sonoma 14.2.1 #> #> Matrix products: default #> BLAS: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib #> LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0 #> #> locale: #> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 #> #> time zone: Europe/Berlin #> tzcode source: internal #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> loaded via a namespace (and not attached): #> [1] utf8_1.2.4 future_1.33.0 generics_0.1.3 #> [4] distr6_1.8.4 lattice_0.22-5 listenv_0.9.0 #> [7] digest_0.6.33 magrittr_2.0.3 evaluate_0.23 #> [10] grid_4.3.2 ooplah_0.2.0 fastmap_1.1.1 #> [13] jsonlite_1.8.7 xgboost_1.7.5.1 Matrix_1.6-3 #> [16] backports_1.4.1 survival_3.5-7 param6_0.2.4 #> [19] fansi_1.0.5 scales_1.2.1 mlr3_0.17.0 #> [22] codetools_0.2-19 palmerpenguins_0.1.1 cli_3.6.1 #> [25] rlang_1.1.2 crayon_1.5.2 mlr3viz_0.6.1 #> [28] parallelly_1.36.0 splines_4.3.2 munsell_0.5.0 #> [31] reprex_2.0.2 withr_2.5.2 yaml_2.3.7 #> [34] mlr3pipelines_0.5.0-1 tools_4.3.2 parallel_4.3.2 #> [37] uuid_1.1-1 set6_0.2.6 checkmate_2.3.0 #> [40] dplyr_1.1.3 colorspace_2.1-0 ggplot2_3.4.4 #> [43] mlr3proba_0.5.7 globals_0.16.2 vctrs_0.6.4 #> [46] R6_2.5.1 lifecycle_1.0.4 fs_1.6.3 #> [49] dictionar6_0.1.3 mlr3misc_0.13.0 pkgconfig_2.0.3 #> [52] pillar_1.9.0 gtable_0.3.4 data.table_1.14.8 #> [55] glue_1.6.2 Rcpp_1.0.11 lgr_0.4.4 #> [58] paradox_0.11.1 xfun_0.41 tibble_3.2.1 #> [61] tidyselect_1.2.0 rstudioapi_0.15.0 knitr_1.45 #> [64] htmltools_0.5.7 rmarkdown_2.25 compiler_4.3.2 ```