marlonecobos / kuenm

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

kuenm_ceval function runs tooo slowly #62

Closed NimoLululu closed 9 months ago

NimoLululu commented 10 months ago

Hi everyone, I just finished running 'cuenm_cal,' which took me 10 hours. However, in the evaluation section, it appears that R language is not working at all. The progress started at 0.08% and remained at that value for an hour, without any warning. [CPU only 4%, RAM40%]

Have you ever met this problem? How did you fix it? Shall I keep waiting?

evaluate <- kuenm_ceval(path = "F://kuenm//20240108output",occ.joint = "Sp_joint.csv",

Partial ROCs, omission rates, and AICcs calculation, please wait...

lcsjunior commented 10 months ago

@NimoLululu We also had problems with the ceval. We debugged the project and verified that for some scenarios the files occ_train.csv, occ_test.csv and occ_joint.csv must have only three columns: species, logitude and latitude. If it has more than three columns, it occurs in the raster and kuenm loops infinitely and silently. I don't know if that would be your case. I see the examples from @marlonecobos.

Interestingly, I ran the project example yesterday and ceval was stuck at 18%. I'm trying again today. image

Command sequence:

library(kuenm)
library(raster)

setwd("/home/lc/Documents/ku.enm_example_data/A_americanum")

occ_joint <- "aame_joint.csv"
occ_tra <- "aame_train.csv"
M_var_dir <- "M_variables"
batch_cal <- "Candidate_models"
out_dir <- "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 <- "/home/lc/Documents/ku.enm_example_data/A_americanum"
wait <- FALSE
run <- TRUE

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, wait = wait, run = run)

occ_test <- "aame_test.csv"
out_eval <- "Calibration_results"
threshold <- 5
rand_percent <- 50
iterations <- 100
kept <- TRUE
selection <- "OR_AICc"
paral_proc <- FALSE

cal_eval <- kuenm_ceval(path = out_dir, occ.joint = occ_joint, occ.tra = occ_tra, occ.test = occ_test, batch = batch_cal,
                        out.eval = out_eval, threshold = threshold, rand.percent = rand_percent, iterations = iterations,
                        kept = kept, selection = selection, parallel.proc = paral_proc)
NimoLululu commented 10 months ago

@lcsjunior ,Thank you for your assistance and sharing. This problem was fixed by using your code. It took around 20 hours. Marlon also replied me and indicated that 'path' was defined wrongly in my code.