marlonecobos / kuenm

kuenm: An R package for detailed calibration and construction of Maxent Ecological Niche Models.
63 stars 24 forks source link

Can it be true that the vignette creates 1581 calibration models for A_americanum in the tutorial #25

Closed kamaulindhardt closed 1 year ago

kamaulindhardt commented 3 years ago

In the vignette's function kuenm_cal() I get 1581 calibration model, that I find quite a lot. In addition it slows down my calculations. Any idea?

If asked and run = TRUE, allow running as administrator.
Process finished
A maxent shell script for creating 1581 calibration models has been written
Check your working directory!!!    /Users/kamaulindhardt_1/Library/Mobile Documents/com~apple~CloudDocs/MSc Wageningen University /Internship ICRAF-ERA/R notes, codes and content/kuenm-master
bash: /Users/kamaulindhardt_1/Library/Mobile: No such file or directory

I have specified variables and arguments exactly as in the vignettes

Model calibration

Candidate models

Candidate models are a large set of candidate models created to respond to the need to test broad suites of parameter combinations, such as, distinct regularization multiplier values, various feature classes, and different sets of environmental variables. The following code calls the help page of the function kuenm_cal.

help(kuenm_cal)
setwd("/Users/kamaulindhardt_1/Library/Mobile Documents/com~apple~CloudDocs/MSc Wageningen University /Internship ICRAF-ERA/R notes, codes and content/kuenm-master/ku.enm_example_data")


The next chunk of code is for preparing the arguments to use the function. These variables should be changed according to each case.

# Variables with information to be used as arguments. Change "YOUR/DIRECTORY" by your actual directory.
occ_joint <- "./ku.enm_example_data/A_americanum/aame_joint.csv"
occ_tra <- "./ku.enm_example_data/A_americanum/aame_train.csv"
M_var_dir <- "./ku.enm_example_data/A_americanum/M_variables/"
batch_cal <- "./ku.enm_example_data/A_americanum/Candidate_models"
out_dir <- "./ku.enm_example_data/A_americanum/Candidate_Models"
reg_mult <- c(seq(0.1, 1, 0.1), seq(2, 6, 1), 8, 10)
f_clas <- "all"
args <- NULL # e.g., "maximumbackground=20000" for increasing the number of pixels in the bacground or
             # note that some arguments are fixed in the function and should not be changed
maxent_path <- "/Users/kamaulindhardt_1/Library/Mobile Documents/com~apple~CloudDocs/MSc Wageningen University /Internship ICRAF-ERA/R notes, codes and content/kuenm-master/ku.enm_example_data/A_americanum"
wait <- FALSE
run <- TRUE


The following is the code for using the function.

kuenm_cal(occ.joint = occ_joint, occ.tra = occ_tra, M.var.dir = M_var_dir, 
          batch = batch_cal, out.dir = out_dir, reg.mult = reg_mult, 
          f.clas = f_clas, args = args, maxent.path = maxent_path, max.memory = 1000,
          wait = wait, run = run)
kamaulindhardt commented 3 years ago

As you see I also get the error issue

bash: /Users/kamaulindhardt_1/Library/Mobile: No such file or directory

Why is that?

kamaulindhardt commented 3 years ago

How do I get the window of the evaluation process to show progress on my macOS? My "Partial ROCs, omission rates, and AICcs calculation, please wait..." progress in RStudio stays on 0 % indefinitely. So something is clearly wrong.

When I forcefully terminate the process I get this error message

Error in file(con, "r") : invalid 'description' argument

HNKamau commented 2 years ago

I am having similar challenges - Is there a solution to the above?

kamaulindhardt commented 2 years ago

Dear authors of kuenm @marlonecobos

Have you any updates on this issue? Is it something you see only in Mac OS or across all operating systems?

Best regards, Kamau

marlonecobos commented 2 years ago

Hi @kamaulindhardt, multiple things are wrong in your example.

  1. Yes, you are creating a lot of models. These candidate models result from combining sets of variables, feature classes, and regularization multipliers. See the paper for a detailed explanation of why you do that. https://peerj.com/articles/6281/
  2. Use a simpler working directory, the one you have has spaces and even commas on it. Try to make it closer to the root.
  3. Make sure you are defining the names correctly, and only include the "complete" path for the directory of Maxent.
  4. Make sure java and java development kit (or similar) are installed.
  5. The bar you see in videos can only be obtained in Windows, MAC and Linux users have simpler progress bars.

I just ran the analyses with the example data and everything went well.

Hopefully my comments from above help.

kamaulindhardt commented 2 years ago

Thank you @marlonecobos for your reply!

It is a while I ran into this problem – but I will re-try it taking your feedback into account.,