sylvainschmitt / SSDM

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

User bug with dismo::evaluate #132

Open kurtvanwyk opened 6 months ago

kurtvanwyk commented 6 months ago

Hi all,

I am running a few different ESDMs and one SSDM using reptile and amphibian presence-only data from South Africa and Zimbabwe. When running the following script (or the equivalent for ESDMs):

Reptiles_SSDM <- stack_modelling(c("GLM","GAM","RF","MAXENT"), Reptiles_occ, env_final,
                          rep = 1, Xcol = "Long", Ycol = "Lat", Spcol = "Species",
                          PA = list(nb=10000, strat="random"), cv = "holdout",
                          cv.param = c(0.8, 1), ensemble.metric = "AUC", ensemble.thresh = 0.7,
                          weight = TRUE, bin.thresh = "SES", method = "pSSDM")

I continue to encounter the following error:

Error in dismo::evaluate(p = predicted.values[which(eval.testdata$Presence == : cannot evaluate a model without absence and presence data that are not NA

I cannot seem to trace the fault. My Occurrences and Env data are in the same projection, and I don't see why the pseudo-absences would be NA.

Additionally, including the GBM algorithm immediately causes R to abort. I am using R 4.3.2 and RStudio 2023.12.1.

Any insight would be greatly appreciated.

Kind regards,

Kurt

sylvainschmitt commented 4 months ago

Dear @kurtvanwyk , I can't reproduce your issue with last version of R. Try reinstalling your packages, especially dismo. And if the bug persist try to make a reproducible example with the data from the package.