rvalavi / blockCV

The blockCV package creates spatially or environmentally separated training and testing folds for cross-validation to provide a robust error estimation in spatially structured environments. See
https://doi.org/10.1111/2041-210X.13107
GNU General Public License v3.0
106 stars 22 forks source link

presence-background with Maxent #5

Closed carbonmetrics closed 4 years ago

carbonmetrics commented 4 years ago

I am trying to use blockCV with dismo::maxent. The advantage of dismo for me is the integration with raster: I can directly plot both the model results and the prediction.

I can't get blockCV to work with dismo::maxent, because the trainSet from blockCV generates a vector. In that case, dismo::maxent wants background data; the predictors and occurrence instances are not enough.

How can I get this to work (preferably with foreach in view of its parallel processing capabilities)?

rvalavi commented 4 years ago

You can use blockCV with any of the models in dismo.

The easiest way to do that is:

  1. generate the background point in dismo
  2. combine it with the presence points
  3. extract the covariate values
  4. use all the data (presence + background) in blockCV and generate folds
  5. model the data with dismo::maxent like the other models I explained in the vignette
carbonmetrics commented 4 years ago

Thanks! I have be / will be in the field with limited comms, but will work through your recommendations.