MAXENT preventing the EnsembleForecasting function of running #245
Labels
bug
Something isn't working
external problem
Issue coming from external source (code, computer, ...)
I'm trying to run an ensemble model whereby I'm not making any real projections in time or space,
I just have presences and pseudo-absences and want to model habitat suitability using an ensemble model.
The problem is related to MAXENT, as running the code without it works.
I first format the data;
myBiomodData1 <- BIOMOD_FormatingData(resp.name= myRespName1,
resp.var = myResp1,
expl.var = stack1,
resp.xy = myRespXY1,
filter.raster=TRUE,
PA.nb.rep = 1
I then use BIOMOD_modeling to create the 'submodels', three runs for each.
myBiomodModelOut1 <- BIOMOD_Modeling(
myBiomodData1,
models = c('GLM','GBM','FDA', 'RF', 'MARS','MAXENT','CTA','ANN','GAM','SRE'),
bm.options = myBiomodOption,
nb.rep=3,
data.split.perc=70,
var.import=3,
metric.eval = c('ROC', "TSS"),
save.output = TRUE,
scale.models = FALSE,
do.full.models=FALSE,
do.progress=TRUE)
Besides a warning (see below), all models are computed.
Warning message:
In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
The evaluations for the MAXENT submodels are adequate.
I then create an ensemble model using the following criteria;
myBiomodEM1 <- BIOMOD_EnsembleModeling(
bm.mod = myBiomodModelOut1,
em.by = 'all',
metric.eval = 'TSS',
metric.select='TSS',
metric.select.thresh = 0.5,
em.algo=c('EMca', 'EMwmean'))
To then attain a raster predicting habitat, I use the BIOMOD_EnsembleForecasting function.
Even though my desired output is not really a 'forecast', in so much that I have no new environment to project to, so the 'new.env' is the same RasterStack the 'expl.var' in the BIOMOD_formatingdata function. I suspect this may be causing an issue? I'm not sure if I would call the type of model output I want 'projections', or 'forecasts'.
myBiomodEF <- BIOMOD_EnsembleForecasting(
proj.name="ensemble",
bm.em = myBiomodEM1,
output.format='.img',
metric.binary='TSS',
new.env=stack1
)
The forecasting function runs, but at each projection of one of the three MAXENT runs, I get a pop-up error from outside of R saying :
Error in file C\Layers.\Species\models\1681839621\Species_PA1_RUN1_MAXENT_outputs\agriprop.asc:java.lang.NumberFormatException: For input string:"NODATA_value"
The final error in R , after all single models are projected, reads as follows:
Error: [rast] extents do not match
In addition: Warning messages: 1: In system(command = maxent.command, wait = TRUE, intern = TRUE) : running command 'java -mx512m -cp "C:/layers/maxent.jar" density.Project "./Species/models/1681839621/Species_PA1_RUN1_MAXENT_outputs/Species_PA1_RUN1.lambdas" "./Species/models/1681839621/Species_PA1_RUN1_MAXENT_outputs" "./Species/models/1681839621/Species_PA1_RUN1_MAXENT_outputs/projMaxent.asc" doclamp=false visible=false autorun nowarnings notooltips' had status 1 2: In system(command = maxent.command, wait = TRUE, intern = TRUE) : running command 'java -mx512m -cp "C:/layers/maxent.jar" density.Project "./Species/models/1681839621/Species_PA1_RUN2_MAXENT_outputs/Species_PA1_RUN2.lambdas" "./Species/models/1681839621/Species_PA1_RUN2_MAXENT_outputs" "./Species/models/1681839621/Species_PA1_RUN2_MAXENT_outputs/projMaxent.asc" doclamp=false visible=false autorun nowarnings notooltips' had status 1 3: In system(command = maxent.command, wait = TRUE, intern = TRUE) : running command 'java -mx512m -cp "C:/layers/maxent.jar" density.Project "./Species/models/1681839621/Species_PA1_RUN3_MAXENT_outputs/Species_PA1_RUN3.lambdas" "./Species/models/1681839621/Species_PA1_RUN3_MAXENT_outputs" "./Species/models/1681839621/Species_PA1_RUN3_MAXENT_outputs/projMaxent.asc" doclamp=false visible=false autorun nowarnings notooltips' had status 1
The text was updated successfully, but these errors were encountered: