Prepare spatial and spatiotemporal cross validation sets
Source:R/base_learner.R
generate_cv_index_sp.Rd
Prepare spatial and spatiotemporal cross validation sets
Usage
generate_cv_index_sp(
data,
target_cols = c("lon", "lat"),
cv_make_fun = spatialsample::spatial_block_cv,
...
)
Arguments
- data
data.table with X, Y, and time information.
- target_cols
character(3). Names of columns for X, Y. Default is
c("lon", "lat")
. It is passed to sf::st_as_sf to subsequently generate spatial cross-validation indices usingspatialsample::spatial_block_cv
andspatialsample::spatial_clustering_cv
.- cv_make_fun
function(1). Function to generate spatial cross-validation indices. Default is
spatialsample::spatial_block_cv
.- ...
Additional arguments to be passed to
cv_make_fun
.