Open tongruiju opened 2 days ago
Hi !
This is a commun problem with ENMeval
and MAXENT
. It opens some clusters and the closure is not always perfect on Windows.
I will advise you to try with biomod2 version 4.2-6-2
first. If you still encounter the same error, you can try to run:
env <- foreach:::.foreachGlobals
rm(list=ls(name=env), pos=env)
between your tuning and your modeling.
In the same time, the argument bm.options
is obsolete. Your code will be :
myBiomodModelOut <- BIOMOD_Modeling(
bm.format = myBiomodData,
models = c('GBM', 'MAXENT'),
CV.strategy = 'kfold',
CV.nb.rep = 1,
CV.k = 10,
CV.perc = 0.8,
var.import = 3,
metric.eval = c('TSS','ROC', 'KAPPA'),
OPT.strategy = "user.defined",
OPT.user.val = list(MAXENT.binary.MAXENT.MAXENT = tuning.result.maxent,
GBM.binary.gbm.gbm = tuning.result.gbm)
)
Don't hesitate if you still have some questions, Hélène
Hi Hélène,
I have updated my biomod2 to version 4.2-6-2. However, I encountered the following error. Could you provide any references or resources that I can use to update my old code to version 4.2-6-2? Best, Ruiju
**> tuning.result.gbm <- bm_Tuning(model = "GBM",
Hello Ruiju,
Have you run all the beginning of your code? There is no big difference about options between version 4.2-5-2 and version 4.2-6-2.
However, it seems that biomod2
doesn't find bm.options
. I will advise to clean and restart properly 😄
Thanks, Hélène
Hi,
We have tuned the parameters as detailed below, but subsequently encountered the error: 'Error in summary.connection(connection) : invalid connection'. This error appears to be associated with the transfer of tuned parameters, as no such error is reported when we do not perform tuning. Thank you in advance for your assistance.
Best, Ruiju
**> bm.options <- bm_ModelingOptions(data.type = 'binary', models = c('GBM', 'MAXENT'), strategy = 'default', bm.format = myBiomodData)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Build Modeling Options -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Running ENMeval v2.0.3 with maxnet from maxnet package v0.1.4
| | 0% Of 32 total cores using 32... Running in parallel using doSNOW... |=============================================================================================| 100% ENMevaluate completed in 2 minutes 5.9 seconds.
$
_allData_allRun
$distribution [1] "bernoulli"$
_allData_allRun
$data list()$
_allData_allRun
$weights$
_allData_allRun
$var.monotone NULL$
_allData_allRun
$n.trees [1] 2500$
_allData_allRun
$interaction.depth [1] 5$
_allData_allRun
$n.minobsinnode [1] 10$
_allData_allRun
$shrinkage [1] 0.01$
_allData_allRun
$bag.fraction [1] 0.5$
_allData_allRun
$train.fraction [1] 1$
_allData_allRun
$cv.folds [1] 0$
_allData_allRun
$keep.data [1] TRUE$
_allData_allRun
$verbose [1] FALSE$
_allData_allRun
$class.stratify.cv NULL$
_allData_allRun
$n.cores NULL$
_allData_allRun
$memory_allocated [1] 512$
_allData_allRun
$initial_heap_size NULL$
_allData_allRun
$max_heap_size NULL$
_allData_allRun
$background_data_dir [1] "default"$
_allData_allRun
$visible [1] FALSE$
_allData_allRun
$linear [1] TRUE$
_allData_allRun
$quadratic [1] FALSE$
_allData_allRun
$product [1] FALSE$
_allData_allRun
$threshold [1] FALSE$
_allData_allRun
$hinge [1] FALSE$
_allData_allRun
$lq2lqptthreshold [1] 80$
_allData_allRun
$l2lqthreshold [1] 10$
_allData_allRun
$hingethreshold [1] 15$
_allData_allRun
$beta_threshold [1] -1$
_allData_allRun
$beta_categorical [1] -1$
_allData_allRun
$beta_lqp [1] -1$
_allData_allRun
$beta_hinge [1] -1$
_allData_allRun
$betamultiplier [1] 0.5 Levels: 0.5 1$
_allData_allRun
$defaultprevalence [1] 0.5-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Build Single Models -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Checking Models arguments...
!!! argument 'bm.options' is obsolete, please use 'OPT.user' instead Creating suitable Workdir...
Checking Cross-Validation arguments...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Build Modeling Options -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= SP Modeling Summary -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
15 environmental variables ( BPI9 gebco2023PJ_clip o2_mean_2000PJ oa_co3_TRI_MPI20002014_co3satarag_Can20002014_IDW3DPJ_clip1 ph_mean_2000PJ phyc_mean_2000PJ si_mean_2000PJ slope so_mean_2000PJ swd_mean_2000PJ sws_mean_2000PJ thetao_mean_2000PJ TPI wld01_grz_idw3d_ProjminPJ_clip1 wld01_rck_idw3d_Projmin_PJ_clip1 ) Number of evaluation repetitions : 11 Models selected : GBM MAXENT
Total number of model runs: 22
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Error in summary.connection(connection) : invalid connection**