Skip to content

ENH use a metadata-aware cv_class directly as the top-level splitter (#1104) - #1262

Merged
bruAristimunha merged 2 commits into
NeuroTechX:developfrom
bruAristimunha:fix/metadata-splitter-1104
Oct 14, 2026
Merged

bruAristimunha merged 2 commits into
NeuroTechX:developfrom
bruAristimunha:fix/metadata-splitter-1104

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

ENH use a metadata-aware cv_class directly as the top-level splitter (#1104)

A cv_class that declares metadata_columns and implements
split(self, y, metadata) is no longer wrapped as the inner groups-CV:

  • CrossSubjectEvaluation builds it with cv_kwargs and routes it through
    the existing top-level splitter path (fold validation, split metadata,
    train/calibration/test support).
  • CrossSubjectSplitter and CrossSessionSplitter call its split(y, metadata)
    and get_n_splits(metadata) directly.

The splitter owns the whole fold, so rows can be left out of both train
and test (e.g. test one target subject on one session and drop its other
sessions). Ordinary scikit-learn CVs, and LearningCurveSplitter (which has
metadata_columns but split(X, y, groups)), keep the inner-CV path.

Closes #1104

…euroTechX#1104)

A cv_class that declares metadata_columns and implements
split(self, y, metadata) is no longer wrapped as the inner groups-CV:

- CrossSubjectEvaluation builds it with cv_kwargs and routes it through
  the existing top-level splitter path (fold validation, split metadata,
  train/calibration/test support).
- CrossSubjectSplitter and CrossSessionSplitter call its split(y, metadata)
  and get_n_splits(metadata) directly.

The splitter owns the whole fold, so rows can be left out of both train
and test (e.g. test one target subject on one session and drop its other
sessions). Ordinary scikit-learn CVs, and LearningCurveSplitter (which has
metadata_columns but split(X, y, groups)), keep the inner-CV path.
@bruAristimunha
bruAristimunha force-pushed the fix/metadata-splitter-1104 branch from a10a1ba to 7896ef0 Compare October 14, 2026 14:15
@bruAristimunha
bruAristimunha merged commit 6429404 into NeuroTechX:develop Oct 14, 2026
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

Allow a metadata-aware splitter as cv_class (used directly, not wrapped as the inner groups-CV)

1 participant