Spatio-temporal extensions for mlr3.

This package extends the mlr3 package framework by spatiotemporal resampling and visualization methods.

Resampling methods

Currently, the following ones are implemented:

Literature Name R Package Reference mlr3spatiotemporal Name
Spatial CV sperrorest Brenning 2012 ResampleSpCVCoords
Spatial Blocking blockCV Valavi 2019 ResampleSpCVBlock
Environmental Blocking blockCV Valavi 2019 ResampleSpCVEnv
Spatial Buffering blockCV Valavi 2019 ResampleSpCVBuffer

Spatial tasks

  • Task “ecuador” -> mlr_tasks$get("ecuador")
  • Task “diplodia” -> mlr_tasks$get("diplodia")

Visualization methods

Generic S3 function autoplot() for all implemented spatial resampling methods.

The following example shows the resampling method "spcv-coords".

Visualization of all partitions


task = tsk("ecuador")
resampling = rsmp("spcv-coords", folds = 5)

autoplot(resampling, task)

Visualization of the first fold only

autoplot(resampling, task, fold_id = 1)


**Brenning**, A, 2012. “Spatial cross-validation and bootstrap for the assessment of prediction rules in remote sensing: The R Package sperrorest.” In *2012 IEEE International Geoscience and Remote Sensing Symposium*, 5372–5. .
**Valavi** R, Elith J, Lahoz-Monfort JJ, Guillera-Arroita G. blockCV: An R package for generating spatially or environmentally separated folds for k-fold cross-validation of species distribution models. Methods Ecol Evol. 2019; 10:225–232.