-
-
Notifications
You must be signed in to change notification settings - Fork 405
getResamplingIndices(): Translate inner resampling indices to outer indices #2413
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
Conversation
As a side not: I moved The type safetyness of |
Merge branch 'master' into getresampinds # Conflicts: # DESCRIPTION
There seem to be a lot of spurious/outdated changes in this branch. Could you please check that? |
have to check what's wrong in the example. |
p = resample(tune_wrapper, ct, outer, show.info = FALSE, | ||
extract = getTuneResult) | ||
|
||
inner_inds = getResamplingIndicesNew(p, inner = TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here? Tests fail.
Thanks, merging. |
…ndices (mlr-org#2413) * update getResamplingIndices() * add explicit return statement * add test checking translation of inner indices * move purrr from suggests to imports and remove explicit importing notation * no pipes * remove duplicate fields * fix description * fix typo in tests * set_names() needs to be one level higher * update NEWS.md
fixes #2409
So they match the task indices.
The test I added uses a basic "CV" with predefined indices (
fixed = TRUE
) since this resamp method groups the indices (1:30, 31:60, 61:90, etc) and the translation checking is more easy to understand.The implementation is ofc hard to review since it uses three nested
map()
calls. But I think there is no other way to implement this.The test essentially checks that in the inner inds have values that go up to the max index value of the task (in this case 150). Before, the max of inner inds was "obs - (obs/nfolds)", which evaluates to 120 in this test with 150 obs.
Can only be merged after #2412 since it uses code from this PR.