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

`cv_block_size` is unusable for non-interactive processing #30

Closed pat-s closed 1 year ago

pat-s commented 1 year ago

Hi @rvalavi

The new version of spatialBlock(), i.e. cv_block_size() is not usable in third-party packages like {mlr3spatiotempcv} as it always returns a shiny app instead of a simple R object. This is complete blocker for script-based/non-interactive workflows in general.

In my view, the function

Would you consider changing the behavior?

NB: I haven't yet checked if the outputs are backwards-compatible with spatialBlock (are they?). I see almost all arguments have changed. If not, this would be a huge reproducibility issue and I would appreciate not removing the old spatialBlock() but just creating a new standalone function/method that lives alongside the old one.

pat-s commented 1 year ago

Just came across cv_spatial() which looks more like being the successor of spatialBlock() (given it's arguments) even though cv_block_size() is name-wise much closer.

pat-s commented 1 year ago

OK, cv_spatial() is what I was searching for :)

rvalavi commented 1 year ago

@pat-s yep! that is it.

The naming is used to match other blocking methods; the new blocking functions are: cv_spatial, cv_cluster, cv_buffer, and cv_nndm;

Check https://github.com/rvalavi/blockCV#new-updates-of-the-version-30

For buffering (cv_buffer()) use report = FALSE to make it faster;