sylvainschmitt / SSDM

Stacked Species Distribution Modelling R package
Other
41 stars 17 forks source link

correlation output misses one of the algorithms in the ensemble #131

Open AMBarbosa opened 9 months ago

AMBarbosa commented 9 months ago

Hi, The Example in the ?ensemble_modelling help file runs two algorithms, but the output correlation between algorithms is empty. If I add more algorithms, the output correlation misses the first one:

ESDM <- ensemble_modelling(c('MARS', 'CTA', "GLM"), Occurrences, Env, rep = 1,
                           Xcol = 'LONGITUDE', Ycol = 'LATITUDE',
                           ensemble.thresh = c(0.6))

plot(ESDM)

ESDM@algorithm.correlation
#                  CTA.SDM.ensemble GLM.SDM.ensemble
# CTA.SDM.ensemble        1.0000000        0.2152712
# GLM.SDM.ensemble        0.2152712        1.0000000

Regards,

AMBarbosa commented 9 months ago

The algorithm evaluation output (including in the plot(ESDM) graphical window) also misses one of the algorithms:

ESDM <- ensemble_modelling(c('CTA', 'MARS'), Occurrences, Env, rep = 1,
                           Xcol = 'LONGITUDE', Ycol = 'LATITUDE',
                           ensemble.thresh = c(0.6))

ESDM@algorithm.evaluation
#                    threshold       AUC omission.rate sensitivity
# MARS.SDM.ensemble 0.00212256 0.6277778     0.3861386   0.6666667
#                    specificity prop.correct      Kappa calibration
# MARS.SDM.ensemble   0.6133333    0.6138614 0.01401752   0.9317339
#                   kept.model
# MARS.SDM.ensemble          1
sylvainschmitt commented 6 months ago

Thanks @AMBarbosa , weirdly I cant reproduce the bug myself:

> ESDM@algorithm.correlation
                  MARS.SDM.ensemble CTA.SDM.ensemble GLM.SDM.ensemble
MARS.SDM.ensemble         1.0000000        0.4626171        0.7317545
CTA.SDM.ensemble          0.4626171        1.0000000        0.4394027
GLM.SDM.ensemble          0.7317545        0.4394027        1.0000000

Could you give me more information on your environment?

AMBarbosa commented 5 months ago
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21.1

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=pt_PT.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=pt_PT.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] shiny_1.8.1.1 SSDM_0.2.9   

loaded via a namespace (and not attached):
 [1] nlme_3.1-155         sf_1.0-16            fontawesome_0.5.2   
 [4] doParallel_1.0.17    tools_4.1.2          bslib_0.7.0         
 [7] utf8_1.2.4           R6_2.5.1             rpart_4.1.23        
[10] KernSmooth_2.23-22   DBI_1.2.1            mgcv_1.9-1          
[13] colorspace_2.1-0     nnet_7.3-19          raster_3.6-26       
[16] sdm_1.1-8            gbm_2.1.9            sp_2.1-2            
[19] tidyselect_1.2.1     leaflet_2.2.2        compiler_4.1.2      
[22] textshaping_0.3.6    cli_3.6.3            sass_0.4.9          
[25] scales_1.3.0         classInt_0.4-10      randomForest_4.7-1.1
[28] proxy_0.4-27         plotmo_3.6.3         systemfonts_1.0.5   
[31] stringr_1.5.1        digest_0.6.36        dismo_1.3-14        
[34] pkgconfig_2.0.3      htmltools_0.5.8.1    plotrix_3.8-2       
[37] fastmap_1.2.0        itertools_0.1-3      maps_3.4.1.1        
[40] htmlwidgets_1.6.4    rlang_1.1.4          rstudioapi_0.16.0   
[43] jquerylib_0.1.4      generics_0.1.3       farver_2.1.2        
[46] jsonlite_1.8.8       crosstalk_1.2.0      dplyr_1.1.4         
[49] magrittr_2.0.3       Formula_1.2-5        dotCall64_1.1-0     
[52] Matrix_1.6-0         Rcpp_1.0.12          munsell_0.5.1       
[55] fansi_1.0.6          lifecycle_1.0.4      terra_1.7-78        
[58] spThin_0.2.0         stringi_1.8.4        plyr_1.8.9          
[61] grid_4.1.2           parallel_4.1.2       earth_5.3.2         
[64] promises_1.3.0       crayon_1.5.3         shinydashboard_0.7.2
[67] lattice_0.22-5       splines_4.1.2        poibin_1.5          
[70] knitr_1.47           pillar_1.9.0         reshape2_1.4.4      
[73] codetools_0.2-19     glue_1.7.0           vctrs_0.6.5         
[76] png_0.1-8            spam_2.10-0          httpuv_1.6.15       
[79] foreach_1.5.2        gtable_0.3.4         cachem_1.1.0        
[82] ggplot2_3.5.1        TeachingDemos_2.12   xfun_0.45           
[85] mime_0.12            xtable_1.8-4         e1071_1.7-13        
[88] later_1.3.2          ragg_1.2.7           rsconnect_1.1.1     
[91] class_7.3-22         survival_3.5-7       viridisLite_0.4.2   
[94] tibble_3.2.1         iterators_1.0.14     memoise_2.0.1       
[97] fields_15.2          units_0.8-4