Description of the desired feature:
Currently, verde.BlockKFold internally calls block_split() with:
This behavior appears to be fixed and is not exposed as a user-configurable argument.
It would be useful to allow users to pass the adjust parameter through the BlockKFold API, for example:
cv = vd.BlockKFold(
spacing=300000,
n_splits=4,
adjust="region",
)
This would make it possible to choose between the two existing block_split() behaviors:
adjust="spacing": preserve the region bounds and slightly modify the effective spacing.
adjust="region": preserve the requested spacing and slightly modify the region bounds.
This can be particularly relevant in spatial cross-validation workflows where block size has methodological meaning (for example, when chosen from an estimated correlation length scale or variogram range). In such cases, preserving the requested spacing may be preferable to adjusting the spacing itself.
A backward-compatible solution would be to add:
as the default behavior in BlockKFold.
Are you willing to help implement and maintain this feature?
Yes. I would be happy to help test the feature, provide feedback, and contribute a pull request if needed.
Description of the desired feature:
Currently,
verde.BlockKFoldinternally callsblock_split()with:This behavior appears to be fixed and is not exposed as a user-configurable argument.
It would be useful to allow users to pass the
adjustparameter through theBlockKFoldAPI, for example:This would make it possible to choose between the two existing
block_split()behaviors:adjust="spacing": preserve the region bounds and slightly modify the effective spacing.adjust="region": preserve the requested spacing and slightly modify the region bounds.This can be particularly relevant in spatial cross-validation workflows where block size has methodological meaning (for example, when chosen from an estimated correlation length scale or variogram range). In such cases, preserving the requested spacing may be preferable to adjusting the spacing itself.
A backward-compatible solution would be to add:
as the default behavior in
BlockKFold.Are you willing to help implement and maintain this feature?
Yes. I would be happy to help test the feature, provide feedback, and contribute a pull request if needed.