Repository navigation
DOC eldele2021 sleep tutorial: split by subject, as the text says - #1559
Merged
bruAristimunha merged 3 commits intoNov 8, 2026
Merged
Conversation
split() takes recording indices, so the old ids [0-3]/[4, 5] trained on subjects 0-1 and validated on subject 2, while the text said subjects 0-3 and 4-5. Look the subjects up in the description, and load subjects 0-2: the same split the hosted checkpoint (braindecode/plot_sleep_staging_eldele2021) was trained with.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues blocking the tutorial’s subject-split correction.
No open issues 🎉
What changed in this PR
Corrects the sleep-staging tutorial’s subject split so the code and explanation agree while preserving the split used by the pretrained checkpoint.
Changes:
- Loads only subjects 0–2, using subjects 0–1 for training and subject 2 for validation.
- Looks up recording indices through the
"subject"metadata column, keeping both nights of each subject in the same split.
| File | Description |
|---|---|
examples/applied_examples/plot_sleep_staging_eldele2021.py |
Updates subject selection, derives recording indices by subject, and aligns the explanatory comments. |
Review effort: Balanced
| @@ -23,10 +23,8 @@ | |||
|
|
|||
|
|
|||
| Current 2.1.0 (GitHub) | |||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1559 +/- ##
=======================================
Coverage 91.48% 91.48%
=======================================
Files 170 170
Lines 22277 22277
=======================================
Hits 20379 20379
Misses 1898 1898 🚀 New features to boost your workflow:
|
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Nov 9, 2026
Brings in dba9d42 (braindecode#1559, braindecode#1557). No conflicts; NOTICE.txt and docs/whats_new.rst differ from master only by the MEGGPT lines.
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Nov 9, 2026
Brings in the ch_mask series (braindecode#1545, braindecode#1548, braindecode#1540, braindecode#1542-braindecode#1544, braindecode#1549, braindecode#1550) and braindecode#1557/braindecode#1559. No conflicts.
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Nov 9, 2026
Brings in the ch_mask series (braindecode#1545 braindecode#1548 braindecode#1540 braindecode#1549 braindecode#1542 braindecode#1543 braindecode#1544 braindecode#1550), braindecode#1557 and braindecode#1559 (master dba9d42). No conflicts; NOTICE.txt and docs/whats_new.rst carry only this PR's additions over master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
plot_sleep_staging_eldele2021.pysays "Subjects 0-3 are used for training and subjects 4-5 for validation", butBaseConcatDataset.splittakes recording indices, not subject ids. With two nights per subject,train=[0, 1, 2, 3]/valid=[4, 5]meant subjects 0-1 for training and subject 2 for validation; subjects 3-5 were loaded and never used.Changes
"subject"description column, so the code does what the text says and no night of the validation subject is seen in training.braindecode/plot_sleep_staging_eldele2021was trained with, so the loaded weights and the displayed history stay consistent (its card now documents this split).Testing