Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspect "'k' is bigger than the number of the blocks" error #17

Closed
pat-s opened this issue Sep 3, 2019 · 3 comments
Closed

Inspect "'k' is bigger than the number of the blocks" error #17

pat-s opened this issue Sep 3, 2019 · 3 comments

Comments

@pat-s
Copy link
Member

pat-s commented Sep 3, 2019

library(mlr3spatiotemporal)

library(mlr3)
task <- tsk("ecuador")

# Instantiate Resampling
rcv <- rsmp("spcv-block")
rcv$param_set$values <- list(folds = 20)
rcv$instantiate(task)
#> Error in blockCV::spatialBlock(speciesData = points, theRange = self$param_set$values$range, : 'k' is bigger than the number of the blocks

Created on 2019-09-03 by the reprex package (v0.3.0)

@be-marc
Copy link
Member

be-marc commented Sep 3, 2019

range or cols and rows are not set. Therefore, ResamplingSpCVBlock uses the default value of cols and rows, which is 4. You want to assign 20 folds to 16 blocks, which does not work.

@pat-s
Copy link
Member Author

pat-s commented Sep 3, 2019

Thanks for the quick heads-up, saves me some time. Will account for it with an appropriate error msg. Maybe changing the default even.

@pat-s
Copy link
Member Author

pat-s commented Sep 4, 2019

Now using rows = 4 and cols = 4 and returning a more informative error message if this combination is still < than folds.

5727d57

@pat-s pat-s closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants