RaphaelS1 / survivalmodels

Implementations of survival models in R
https://raphaels1.github.io/survivalmodels/
Other
57 stars 13 forks source link

ValueError: cannot convert float NaN to integer #53

Open darentsai opened 2 months ago

darentsai commented 2 months ago

Dear maintainer,

I just installed this excellent package. When running the example of coxtime() it shows

library(survivalmodels)

# install the required Python modules
install_pycox(pip = TRUE, install_torch = TRUE)
install_keras(pip = TRUE, install_tensorflow = TRUE)

# Run example
coxtime(data = simsurvdata(50))

Error in py_call_impl(callable, call_args$unnamed, call_args$named) : ValueError: cannot convert float NaN to integer

Obviously simsurvdata() cannot generate NaN.

I have downgraded pandas and tabnet to the required version but it still crashes.

Thanks for any reply!


Python version 3.12.4
sessionInfo()

R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] survivalmodels_0.1.19

loaded via a namespace (and not attached):
 [1] utf8_1.2.4        Matrix_1.7-0      lattice_0.22-6    reticulate_1.38.0 rappdirs_0.3.3   
 [6] splines_4.4.0     glue_1.7.0        png_0.1-8         lifecycle_1.0.4   cli_3.6.2        
[11] fansi_1.0.6       vctrs_0.6.5       grid_4.4.0        compiler_4.4.0    rprojroot_2.0.4  
[16] here_1.0.1        rstudioapi_0.16.0 tools_4.4.0       pillar_1.9.0      Rcpp_1.0.12      
[21] rlang_1.1.4       jsonlite_1.8.8
RaphaelS1 commented 2 months ago

Hey I'm sorry but I can't be much help. We just use pycox in the backend which is super buggy, nothing I can fix on the R side