-
Notifications
You must be signed in to change notification settings - Fork 225
Implement WithinSubjectSplitter #952
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
Implement WithinSubjectSplitter #952
Conversation
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
|
@copilot solve the precommit |
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.
Pull request overview
This PR implements WithinSubjectSplitter, a new cross-validation splitter that performs k-fold splits within each subject across all their sessions. This completes the splitter API alongside existing splitters for within-session, cross-session, and cross-subject evaluation strategies.
Changes:
- Added
WithinSubjectSplitterclass with stratified k-fold cross-validation across all sessions within each subject - Exported the new splitter in the public API
- Added comprehensive test coverage with parametrized tests for compatibility and split counting
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| moabb/evaluations/splitters.py | Implemented WithinSubjectSplitter class following the same pattern as WithinSessionSplitter; fixed typo "cros-validation" → "cross-validation" |
| moabb/evaluations/init.py | Exported WithinSubjectSplitter in the public API |
| moabb/tests/test_splits.py | Added test_within_subject_compatibility, test_within_subject_get_n_splits, and extended test_custom_inner_cv parametrization; implemented eval_split_within_subject helper function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
|
You are missing the api.rst documentation, can you update? |
|
@copilot, you are missing the api, the RST documentation, and the What's New " file (put my name Bruno Aristimunha). Can you update? |
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
Implementation Plan for WithinSubjectSplitter
Summary
Successfully implemented
WithinSubjectSplitterfollowing the existing codebase patterns. The implementation:Key Features:
Files Changed:
moabb/evaluations/splitters.py: Added WithinSubjectSplitter class (105 lines)moabb/evaluations/__init__.py: Exported WithinSubjectSplittermoabb/tests/test_splits.py: Added tests for WithinSubjectSplitter (48 lines)docs/source/api.rst: Added WithinSubjectSplitter to API documentationdocs/source/whats_new.rst: Added enhancement entry with Bruno Aristimunha's nameTesting:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.