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

library(mlr3)
library(mlr3spatiotemporal)
library(ggplot2)

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

autoplot(resampling, task)

Visualization of the first fold only

autoplot(resampling, task, fold_id = 1)

References

Brenning, Alexander. 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*. IEEE. .
Valavi, Roozbeh, Jane Elith, José J. Lahoz-Monfort, and Gurutzeta Guillera-Arroita. 2018. “blockCV: An R Package for Generating Spatially or Environmentally Separated Folds for K-Fold Cross-Validation of Species Distribution Models,” June. Cold Spring Harbor Laboratory. .