Model-R / modleR

An ecological niche model workflow based on dismo
https://model-r.github.io/modleR
51 stars 24 forks source link

Issue with randomforest #85

Open ACalleros opened 3 years ago

ACalleros commented 3 years ago

Hi. I'm trying to model the distribution of an invasive fish. ModleR is using 900 points and 4 predictors. When getting to the RandomForest bit, it stops and returns this warning:

>rf
Remember a variable selection was performed 
 retained variables: wc2.1_30s_bio_2-wc2.1_30s_bio_3-wc2.1_30s_bio_4-srad_mean-tmax 

Pseudoxiphophorus bimaculatus rf run number 1 part. nb. 3
fitting models
Error in sample.int(length(x), size, replace, prob) : 
  cannot take a sample larger than the population when 'replace = FALSE'

How can I fix this?

saramortara commented 3 years ago

Hi, probably is the case when the presences outnumber the absences, so equalize cannot sample correctly as in issue #33 . We think there is a way of fixing it, and we will let you know