ENMeval icon indicating copy to clipboard operation
ENMeval copied to clipboard

Use removeDuplicates in other.settings = other.args

Open daniellesloan opened this issue 10 months ago • 7 comments

Hi Jamie, I am trying add "removeDuplicates=FALSE" using other.settings and other.args but I can't get it to work. I've tried using the format that you recently suggested how to pass the argument "maximumiterations=10000", with no luck. Any suggestions? Here is my code:

enmeval_results <- ENMevaluate(pres, # presence records env, # environmental layers bg = bgp, # background points tune.args = list( # tuning arguments fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), # regularisation multiplier partitions = partition, algorithm = "maxent.jar", other.settings = list(other.args = c("removeDuplicates=FALSE"))) Thanks,

Danielle

daniellesloan avatar May 03 '24 16:05 daniellesloan

Danielle,

Thanks for using the package. Have you updated to v2.0.5? These changes are in this version. It's on the branch "v205_draft". I will be updating the package on CRAN soon, but for now, please use @.***_draft")`.

Jamie

On Sat, May 4, 2024, 1:19 AM Danielle Sloan @.***> wrote:

Hi Jamie, I am trying add "removeDuplicates=FALSE" using other.settings and other.args but I can't get it to work. I've tried using the format that you recently suggested how to pass the argument "maximumiterations=10000", with no luck. Any suggestions? Here is my code:

enmeval_results <- ENMevaluate(pres, # presence records env, # environmental layers bg = bgp, # background points tune.args = list( # tuning arguments fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), # regularisation multiplier partitions = partition, algorithm = "maxent.jar", other.settings = list(other.args = c("removeDuplicates=FALSE"))) Thanks,

Danielle

— Reply to this email directly, view it on GitHub https://github.com/jamiemkass/ENMeval/issues/156, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP6LWZ3CXW2GULU2TDVKZ3ZAO2ITAVCNFSM6AAAAABHFZEZRCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TQMBRGU4TSMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jamiemkass avatar May 03 '24 21:05 jamiemkass

Hi Jamie,

Thanks for getting back to me so quickly. Upon your advice I have just updated to v2.0.5 and I'm still unable to prevent it from removing duplicates (warning message: * Removed 297 occurrence localities that shared the same grid cell.). Have I used the arguments correctly with the proper syntax?

enmeval_results <- ENMevaluate(train, # presence records env, # environmental layers bg = bgp, # background points tune.args = list( # tuning arguments fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), # regularisation multiplier partitions = partition, algorithm = "maxent.jar", other.settings = list(other.args = c("removeDuplicates=FALSE")))

Thanks,

Danielle

daniellesloan avatar May 03 '24 22:05 daniellesloan

Danielle,

Ah, so sorry. This removal of duplicate points is actually implemented inside ENMeval automatically. I don't currently have a way to shut this off, but I can add it in a few days. I'll let you know when it's updated.

On Sat, May 4, 2024, 7:27 AM Danielle Sloan @.***> wrote:

Hi Jamie,

Thanks for getting back to me so quickly. Upon your advice I have just updated to v2.0.5 and I'm still unable to prevent it from removing duplicates (warning message: * Removed 297 occurrence localities that shared the same grid cell.). Have I used the arguments correctly with the proper syntax?

enmeval_results <- ENMevaluate(train, # presence records env, # environmental layers bg = bgp, # background points tune.args = list( # tuning arguments fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), # regularisation multiplier partitions = partition, algorithm = "maxent.jar", other.settings = list(other.args = c("removeDuplicates=FALSE")))

Thanks,

Danielle

— Reply to this email directly, view it on GitHub https://github.com/jamiemkass/ENMeval/issues/156#issuecomment-2093840098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP6LWZKJCBK2RQDDLE32LDZAQFORAVCNFSM6AAAAABHFZEZRCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJTHA2DAMBZHA . You are receiving this because you commented.Message ID: @.***>

jamiemkass avatar May 04 '24 00:05 jamiemkass

Hi Jamie,

Thanks, I'll keep an eye out for your update.

Danielle

daniellesloan avatar May 04 '24 16:05 daniellesloan

@daniellesloan I just added this functionality, so please download v2.0.5 and try it. Set other.settings = list(removeduplicates = FALSE). Please let me know if this works for you.

jamiemkass avatar May 08 '24 02:05 jamiemkass

Unfortunately I'm running into a couple of error messages which stop the function running.

When I use other.settings = list(removeduplicates = FALSE in my code:

enmeval_results <- ENMevaluate(train, env, bg = bgr, tune.args = list( fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), partitions = "block", algorithm = "maxent.jar", other.settings = list(removeduplicates = FALSE))

I get this error message: Error in if (!(partitions %in% c("block", "checkerboard", "user")) & other.settings$validation.bg == : argument is of length zero.

This error forces me to include an argument for validation.bg, to my code: enmeval_results <- ENMevaluate(train, env, bg = bgr, tune.args = list( fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), # regularisation multiplierpartitions = "block", algorithm = "maxent.jar", other.settings = list(removeduplicates = FALSE, validation.bg = "full"))

but I then get this error message which relates to a variable within the function's code: Error in ENMevaluate(train, env, bg = bgr, tune.args = list(fc = c("L", : object 'occs.cellNo' not found

One other quick question that I wanted to ask, when running ENMevaluate() should you use all of your presence points (i.e. training and testing) or only training points?

daniellesloan avatar May 08 '24 12:05 daniellesloan

Oops, sorry. There was a small error in the code. I just fixed it. Please try it again. To answer your question, you should add all the training data you have to ENMevaluate() and it will automatically partition it into groups for cross-validation according to your specifications for partitioning. If you want to use an independent dataset that is not part of the training data, use the "testing" option (see the vignette).

jamiemkass avatar May 08 '24 13:05 jamiemkass

Hi Jamie, apologies for the delay. The code works perfectly, thanks for your help!

daniellesloan avatar Jun 10 '24 14:06 daniellesloan